When I try to use he DB class of eloquent i get this error :
Call to a member function raw() on null
Code :
use Illuminate\Support\Facades\DB;
...
DB::raw("count(id_annonce)")
...
I already tried updating composer and frameworks
When I try to use he DB class of eloquent i get this error :
Call to a member function raw() on null
Code :
use Illuminate\Support\Facades\DB;
...
DB::raw("count(id_annonce)")
...
I already tried updating composer and frameworks
Read this: https://jenssegers.com/index.php/53/using-eloquent-without-laravel
You have to use Capsule
to init the DB connection and boot eloquent. Anyway you can use an alias to call it DB
if you prefere.