Laravel 8 database connection not working

Trying to connect laravel 8 app in production to mysql database. Have tried to follow documentation but it isn’t working. .env file as follows DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 …

Object of class IlluminateDatabaseEloquentBuilder could not be converted to string laravel 7

I have been trying to debug a problem for the past two days, my code, as follows, is first attempting to retrieve the category by its: Controller public function index(Request $request) { $stats = …

Using both Laravel and non-laravel-PHP

I am trying to make Laravel work with a non-laravel script. I need Laravel to handle only routes that are set in the web.php file, and allow anything else that’s not defined to be handled by my non-…

Laravel 8: How to style output at Models

I want to check if the status of users is Active or not. So in order to do this, I’ve added this piece of code to my Model User.php: public function isActive() { if(($this->status) == 1)…

Laravel patch method not supported (even on update method)

HTML PATCHING FORM {{ Form::model($model , [ ‘route’ => [‘admin.friendship.update’, $model->id] , ‘class’=>’needs-validation ajax-form’, ‘method’ => ‘post’ ]) }} @…

How to name a policy for multimodel route in Laravel?

I’m trying to write a policy for this route: Route::delete( ‘users/{user}/locations/{location}’, [UserLocationController::class, ‘destroy’], )->middleware(‘can:delete,user,location’); but …

Laravel won’t send anymore mails after testing my job class on prouction using “QUEUE_DRIVER=sync” [closed]

At first, it sends some emails then stopped without giving any errors, I tested tinker and it gives “null” without receiving anything!! this is my config MAIL_DRIVER=smtp MAIL_HOST=smtp….

illuminate vendors not found in PhpStorm since Laravel 8.36 upgrade

Since I’ve updated to Laravel 8.36 PhpStorm can’t autocomplete and doesn’t find the vendors… what’s the problem ?

Laravel How to set default time as today in daterange filter and how to display the data?

Hi i want to set value of my daterange filter as real-time like today is 5 April 2021 so the default of my daterange filter become from 5 April 2021 to 5 April 2021 and also display the data from my …

Youtube Data API UnknowPart Error When Create Broadcasting

I’m trying to create Youtube live stream through my webpage via Youtube Data API. Whatever I tried, keep getting that error: { “error”: { “code”: 400, “message”:…