After upgrading to Laravel from 5.5 to 5.6.12 I get following exception:
PHP Fatal error: Uncaught ReflectionException: Class env does not exist in /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php:767 Stack trace: 0 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php(767): ReflectionClass->__construct('env') 1 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('env') 2 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('env', Array) 3 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(747): Illuminate\Container\Container->make('env', Array) 4 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php(1210): Illuminate\Foundation\Application->make('env') 5 /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(492): Illuminate\Container\Container->offsetGet('env') 6 /var/www in /var/www/showroom-ng/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 767
I don't see anything related in the upgrade guide.
I tried to dig into Laravel internals, and for example removing code:
if (! $app->environment('testing')) {
ini_set('display_errors', 'Off');
}
from vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php removes one occurrence of mentioned exception, but there is some other place which is causing the same one. I tried to use lower 5.6 versions of Laravel, but it doesn't change anything.