Upgrading my Laravel Yajra Table

994 views Asked by At

I'm currently in 7.5.0 and I want to upgrade to 8.0.3, I followed the steps in https://yajrabox.com/docs/laravel-datatables/master/upgrade but I encountered this error

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating yajra/laravel-datatables-oracle (v7.5.0 => v8.0.3): Downloading (conneDownloading (100%)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize


  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'Yajra\Datatables\DatatablesServiceProvider' not found


Script php artisan optimize handling the post-update-cmd event returned with error code 1

Installation failed, reverting ./composer.json to its original content.
2

There are 2 answers

1
Hectorda On BEST ANSWER
0
Kevin Khew On
  1. In folder config/app.php, temporarily comment out Yajra\Datatables\DatatablesServiceProvider.
  2. Run command composer update.
  3. Uncomment the provider Yajra\Datatables\DatatablesServiceProvider.
  4. Done.
  5. To make sure it works, can run again command composer update.

Reference from: https://yajrabox.com/docs/laravel-datatables/master/upgrade#v5-to-v6