Reputation: 335
I am using laravel 5.4 and php version is 5.6.
I am getting error "Class 'Datatables' not found". I am following standard procedure. I have installed datatable using composer by following command:
composer require yajra/laravel-datatables-oracle:"~7.0"
I added these two lines in config->app file in service provider and aliases:
Yajra\DataTables\DataTablesServiceProvider::class,
'DataTables' => Yajra\DataTables\Facades\DataTables::class,
then publish package :
php artisan vendor:publish --provider=Yajra\DataTables\DataTablesServiceProvider
I am using raw query here is my controller code :
function allvendor(){
$sql="my query";
$results=DB::table(DB::raw("($sql)"));
return Datatables::of($results)->make(true);
}
Upvotes: 2
Views: 7909
Reputation: 2777
It's a typo. You set alias as DataTables
but returned is Datatables
.
Upvotes: 8