Skip to content
Advertisement

Tag: laravel

Database connection not configured

I am currently doing a local project, using MAMP with PHP version 7.4.21 and I can’t seem to run my system because the database is not configured correctly. Here’s my .env and here’s my database.php Answer DB_CONNECTION is the driver that you will use

How to Add data to Database in Laravels

I will to add data to database, but I have an error when I write the code to add data to array, and the error like this, syntax error, unexpected ‘=’, expecting ‘]’ I am using the follwing code: Controller Here’s the view Here’s the route Do you have any solution to this? I have also tried: but that also

Validation to check no existing overlaps with previous bookings

I need to validate that a booking doesn’t overlap in date and time with an existing booking and return and error if a booking is overlapping an existing booking. This is the code I have right now but it isn’t working, and when I make another booking that overlaps an existing booking, it is still passing through and not returning

How to get array in array with laravel and mysql database?

I am using Laravel (PHP) and MySQL for my backend. I am creating methods for setting and getting information from the database. Those information are being send as a json to the frontend. I can send table information like: For this I am using laravel methods like: DB::table(‘user’)->select(‘user.id’, ‘user.name’)->get(); However my friend who is doing the frontend want the following

Laravel – How to display only those Category who have products?

My aim is to not display the category which don’t have any products as of now. I have a drop-down list having all the category (level down to sub-category as well) which giving me the following results. But, I want to achieve following results The database tables are following Category model I have tried following to get category list. which

Laravel: Multilanguage details of a model

I have a model named Point having the following fields: name description lat lng The fields “name” and “description” can be in several languages, so I created two tables for points and their details. There is an index unique on point_id/language. In the model files I have One To Many relationships Now I want to get the Point with details

SQLite3 Update a row based on a select query in another table

Basically I am trying to find a way to update the vehicle’s booking status associated with the client_drivers_license_number after its matched to a variable I will input on my laravel project (123456789 below). I am not sure how I can make an update with values matching from mulitple tables so my best attempt is below so I can explain the

laravel – unable to get data outside foreach

dump($data) outside the foreach loop gives me only 1 data where as dump($data) inside the foreach shows all arrays of rows of data . How can i get all rows of data outside the foreach too? EDIT: Error: Call to a member function paginate() on array Answer In Controller add new function for it After that crate that function for

Advertisement