I want to change the DB in my Laravel project. I move to the .env file and changed the db name. But after I changed the db name, the larval project use still the old db. But why?
5 Answers
Write in your terminal
php artisan config:clear
2 Comments
HansMuff
It doesn't work. I make a change in .evn and .evn_example but nothing happens. This project is a copy from another project but I'dont think that is is a problem?
Abdul Rehman
in that case you have to run composer update command in your terminal.
The laravel configuration take credentials project get data from .env file Please try:
$ composer dump
or
$ composer dumpautoload
and then try to run the command
$ php artisan config:clear
It worked form me when I had the same problem.
If this does not work please delete the content from cache in the directory bootstrap\cache and then try the above command again. Please make backup before delete.
config/database.phplook like?