`PHP Fatal error: Uncaught ReflectionException: Class env does not exist in /var/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
Stack trace:
`
php artisan
I followed the upgrade guide, maybe i missed something, i think not.
Can you first please try one of the following support channels? If you can actually identify this as a bug, feel free to report back.
Also check the issue tracker if your issue can be found somewhere here: https://github.com/laravel/framework/issues?q=is%3Aissue+Class+env+does+not+exist+is%3Aclosed
Are you using Telescope? Is this the problem you're experiencing? https://github.com/laravel/telescope/issues/347
yes, im using Telescope. Tx!
I've runned
php artisan clear
php artisan config:clear
Solved for me
For someone still having the issue, it can be solved adding
<server name="TELESCOPE_ENABLED" value="false"/>
in phpunit.xml
.
Put it together:
<server name="TELESCOPE_ENABLED" value="false"/>
php artisan optimize
I'm not using telescope package, but i've received the same exception on every php artisan
call.
I didn't understand what code block crashes.
Over internet there are many resolutions with cache cleaning. Those users received the same message while running phpunit
command.
I've tried to run phpunit
and received an error related to configuration of one of packages that i've used. So I fixed package config problem and phpunit
command runs well. Also, php artisan
runs OK for now.
Hope my solution will be useful to someone.
I had the same problem after upgrading with composer update
. I had to downgrade. Nothing above worked for me.
Some problem after upgrading from 6 to 7 version
Lumen, upgrading from
Happened during seeding
User::factory()->count(200)->create();
Actually a simple
$factory = User::factory();
was enough to make that error
Workaround:
$factory = \Database\Factories\UserFactory::new();
$factory->count(200)->create();
Most helpful comment
For someone still having the issue, it can be solved adding
<server name="TELESCOPE_ENABLED" value="false"/>
inphpunit.xml
.