Have you tried clearing the cache?
composer clearcache
php artisan cache:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have deployed my app to my staging environment. All is working absolutely fine on my local (homestead) environment.
After deployment I am seeing the error
Class 'Datatables' not found in /var/www/xxx/production/app/Http/Controllers/DatatablesController.php
(This is using the Laravel Datatables package, but I think it's a more general issue rather than package specific).
Have I missed a step?
composer install --no-dev
composer dump-autoload
php artisan optimize
datatables.php so I know the installation is successfulyajra which contains the vendor stuff, all looks fineBut still no joy! Any help much appreciated!
Please or to participate in this conversation.