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.
Clearing Configuration Cache If you want to quickly reset your configuration cache after clearing them, you may instead run the following command: $ php artisan config:cache Configuration cache cleared! Configuration cached successfully! Caching your configuration will also help clear the current configuration cache.
php artisan config:clear Laravel stores all the configuration from App/config directory to a single cached config file at App/bootstrap/cache/config.
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
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With