InfyOmLabs / adminlte-generator

Boilerplate of Laravel with InfyOm Laravel Generator for AdminLTE Templates
https://infyom.com/open-source/laravelgenerator/docs/8.0/boilerplates
388 stars 273 forks source link

ReflectionException when viewing DataTables #73

Closed BurningDog closed 2 years ago

BurningDog commented 4 years ago

After generating DataTables for the User model and navigating to the page, I get this error:

ReflectionException
Class App\DataTables\UserDataTable does not exist

To reproduce

Cause

The generated UserDataTable class uses Yajra\DataTables\Services\DataTable - however, that class was extracted from DataTables into a new package which must be installed like so:

Solution

composer require yajra/laravel-datatables-buttons:^4.0

Note for InfyOm Laravel Generator

Please also add this into the excellent documentation at https://labs.infyom.com/laravelgenerator/docs/7.0/generator-options for DataTables use.

I notice the generator is missing creating these files for DataTables, which adminlte-generator already has:

The command php artisan vendor:publish --tag=datatables-buttons needs to be run so that public/vendor/datatables/buttons.server-side.js is available

ShaileshInfyom commented 2 years ago

I think versions mention in this blog. so, you can refer it as well https://infyom.com/blog/how-to-use-datatables-in-infyom-laravel-generator