5
votes

I (by mistake) run the command php artisan config:cache in my local development setup, due to which all the calls(from my controllers) to the variables defined in .env file (like $_ENV['APP_ENV'], $_ENV['ELS_INDEX'], etc) are resulting in following errors :

ErrorException in MainController.php line 470 <---- This is the line where .env variable is called
Undefined index: APP_ENV

This is the link of : Configuration Caching

Please help me rectify this issue. Thanks in advance.

1

1 Answers

15
votes

Either run

php artisan config:clear

or remove the file /bootstrap/cache/config.php from your Laravel project.

(php artisan config:cache creates /bootstrap/cache/config.php)