Did anyone encounter this issue before? I'm running a Laravel 7 app in production in Forge, it's working fine earlier and now the site came down and the logs contain these errors:
Error #1
production.ERROR: Uncaught ReflectionException: Class translator does not exist in /home/forge/site.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Error #2
production.ERROR: require(): Filename cannot be empty {"exception":"[object] (ErrorException(code: 0): require(): Filename cannot be empty at /home/forge/site.com/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:83)
I'm running
Laravel Framework ^7.24
PHP 7.4
The site is now up again because I tried this answer from StackOverflow. But can anyone explain why I got that error? I have no idea.
Answer from SO
Run composer dump-autoload to fix this kind of issue.
Make sure your .env file is properly written, no hidden space in front. Also make sure APP_KEY is generated. php artisan key:generate