Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to undo the effect of command "php artisan config:cache"?

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.

like image 809
Apprentice Avatar asked Jan 16 '19 09:01

Apprentice


People also ask

Where is php artisan config clear?

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.

What does php artisan config clear do?

php artisan config:clear Laravel stores all the configuration from App/config directory to a single cached config file at App/bootstrap/cache/config.


1 Answers

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)

like image 61
brombeer Avatar answered Oct 10 '22 13:10

brombeer