Skip to content
Advertisement

Tag: laravel

Laravel 8 form to update database

I am creating a simple blog site with CRUD functionality in Laravel 8. I have done this before using the deprecated Laravel forms, but am now trying to do it using HTML forms. However, I am having some problem with the update part of the website. I have a controller called BlogsController with this function to be called to update

Laravel Auth guard does not persist after redirect CustomUser

After redirecting from LoginController Auth::guard(‘user’)->user() returns null LoginConsumer LoginService LoginController Auth::guard(‘web’)->user() returns the right user in each of this layers. But on redirect to route(‘user-home’) (or to any route) the same Auth::guard(‘web’)->user() returns null auth.php Answer The problem was that I didn’t return when implementing IlluminateContractsAuthUserProvider the object from

Laravel 7 does not display flash message

I’m not sure if it has anything to do with it, but I believe it may be something related to my routes, I may be talking nonsense. No flash message is being displayed, I was only able to display a message by setting it to Session::put, retrieving it in the view and then deleting it. When I use with, withErrors,

Laravel 7 not finding with scopes

I have a model called Shift on my application, and I’ve defined my relationships and scopes on it like this: Relationship: With scope: Now, when I retrieve shifts and try to call these scopes, I do the following: However, I get this error… I’m not sure why this is happening? It should pick up the scope shouldn’t it? Answer when

Laravel 8 update JSON column value

I’m trying to update the value of a json column type for all of my users, my query that I’m running through Tinker doesn’t give any errors, it just returns 0 and the columns remain unchanged, what am I doing wrong? My columns on my rows currently has the value of… Answer After I have read the comment below it

Advertisement