I developed laravel app locally and uploaded in shared hosting.
While hosting I changed the database name and username of mysql in the .env and the config/database files.
But in remote its still using the old db name and user which is found in the bootstrap/cache/config file.
So how to clean the bootstrap/cache/config.php file?
The solution for me was to remove the files in the
bootstrap/cache/
directory and then delete thevendor
folder. Re-runcomposer install
and thencomposer dump-autoload
and the above campaigns should run fine. Deleting thevendor
folder and re-runningcomposer install
was the missing link for meHere is the Tip,
Flushing Application cache
php artisan cache:clear
to flush the application cache orphp artisan cache:forget
to discard specific cache.php artisan config:clear
to clear cached configuration of application.Removing Blade Templates cache
You can use
php artisan view:clear
to clear all compiled views.Application Bootstrap cache
If you want to clear the application bootstraper cache,
php artisan optimize:clear
will help you.Route Cache
There also a command to clear the route cache as
php artisan route:clear
.Events and Listeners cache
For events and listeners cache you can use
php artisan event:clear
if you still stuck in finding helpful commands, you can run
php artisan list
and it will list out every command with its description. look for a specific thing you want to perform. if you need migration-related command, you can look inmigration
.