how to clear cache in laravel 5/6/7?

In Laravel php artisan cache:clear command in cmd is used to all the clear cache. It will delete all the cache associated with the connection to the database. Further, on shared hosting for website, you can use below some cache clear in laravels source code in your routes/web.php file to delete your database cache.

list of command for laravel cache clear

let’s see We included several list of command for clear cache from view, route, config clear command in cmd.

laravel delete cache files manually,laravel clear cache/config,laravel clear cache without artisan,laravel clear session cache,laravel clear cache env,laravel cache,laravel cache not working,laravel model cache
Clear Cache Programmatically in Laravel

Step to clear cache in Laravel

Clear database cache
In php web application to run php artisan cache:clear command is used to remove cache. It will remove all the cache associated with the db connection.

php artisan cache:clear

routes/web.php

Laravel Clear Cache on Shared Hosting Server

CLEARING CACHES IN LARAVEL 5|6|7 (BROWSER)

Route::get('/all-db-clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return "Your All Databse Cache is cleared";
});

Clear config cache

To clear config cache of your web application run below command on terminal.

php artisan config:cache

Clear route cache

To clear route cache of your web application run below command on terminal.

php artisan route:clear

Clear view cache

To clear Cache compiled all the balde view files of your web php project issue below command from terminal.artisan view:clear clears all compiled view blade files from Like storage/framework/views/.

php artisan view:clear

Clear bootstrap cache

To clear bootstrap cache of your web application run below command on terminal.

php artisan cache:clear

Clear route cache

To clear route cache of your application run below command on terminal.

php artisan route:clear

I hope you get an idea about cache clear.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment