lundi 30 octobre 2017

Laravel: Class 'App\DB' not found

I am trying to use DB class to run query. I have used it in my controller like this:

use \DB;

And I am using it in my code like this:

$changeCar = DB::select(DB::raw($query));

I have tried including it like this:

use Illuminate\Support\Facades\DB

But still the same. Also, tried it with the backslash in the code and not including it like this:

$changeCar = \DB::select(\DB::raw($query));

Still the same. What am I doing wrong here? Any help?

P.S: My laravel version is 5.4.33



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire