Skip to content

Tag: laravel

How to get all the selected values from a multiselect input?

I am using Laravel and I tried to used die(var_dump(‘$request->input(‘users’))); to check the data that are selected using a multiselect input. When I selected all 3 users, the output was just showing the last user id like this This is the input. The name was set as user[0] because the in…

Laravel how to create a seeder based on array

How can I create a laravel-seeder based on an array? I have an array like this: So instead of doing like this for each entry, I was hoping there might be another way to achieve that? Answer Option A) Option B) Note: Insert doesn’t automatically populate the timestamp columns.

Laravel Query Sending Different Result For Same Problem

Hi I am trying to create a one on one messaging system on LARAVEL. It was working all fine until for some users it started showing different result then expected. And it happens only for some users.. What is wrong with this query After I return $messages the result is like this… Working Result: Messages…

Trying to access array offset on value of type null in laravel

I am getting this error when I am trying to create a new object I am using this package https://github.com/srmklive/laravel-paypal to integrate the PayPal ExpressCheckout in my Laravel app Error Message ErrorException Trying to access array offset on value of type null Answer You should clear the cache. Run t…

Shuffle() returns same results

I’m having a problem with using a basic shuffle() function in Laravel. It returns the same result, which seems to be changing once every 10 or 20 minutes. Here’s the basic code I’m testing: And here’s the log: Answer You probably initialize your random seed with a constant value somewh…