Laravel Clear Cache Using Artisan Command (CLI)

This is going to be a tutorial session where we wil discuss on how to clear cache from blade (views), routes, config, etc using the command line and artisan command.

When our app is product mode (live), we need to make cache in larvel projects for better completion. But if our application is in development mode then what we want to do is not get cured due to the cache. At this time we need to clear the cache.

List of the cache clear commands, see below

1. Clear Route Cache

Use the below command and clear your routes cache :

php artisan route:cache

2. Clear Cache Laravel Application

Use the below command and clear your application cache :

php artisan cache:clear

3. Laravel Clear Config Cache

Use the below command and clear your config cache :

php artisan config:cache

4. Clear View Cache Laravel

Use the below command and clear your view (blade) cache :

php artisan view:clear

5. Reoptimized Class

php artisan optimize

We do not have access to SSH on shared hosting servers. In such case, we can clear the cache by typing the code in route file.

For this, go to your web.php file and put below code for clear cache of your application :

  //Clear route cache:
 Route::get('/route-cache', function() {
     $exitCode = Artisan::call('route:cache');
     return 'Routes cache cleared';

 //Clear config cache:
 Route::get('/config-cache', function() {
     $exitCode = Artisan::call('config:cache');
     return 'Config cache cleared';

// Clear application cache:
 Route::get('/clear-cache', function() {
     $exitCode = Artisan::call('cache:clear');
     return 'Application cache cleared';

 // Clear view cache:
 Route::get('/view-clear', function() {
     $exitCode = Artisan::call('view:clear');
     return 'View cache cleared';



October 3, 2020 7:04 AM

casino bonus codes <a href=" ">casino game </a> casino blackjack


November 11, 2020 2:51 PM

Home | Pariwartan Technologies [url=]unseysbvcj[/url] nseysbvcj <a href="">anseysbvcj</a>


December 14, 2020 7:03 AM

Home | Pariwartan Technologies ixnhrfsy [url=]uixnhrfsy[/url] <a href="">aixnhrfsy</a>


January 15, 2021 1:56 AM

Home | Pariwartan Technologies eepsxtyisi <a href="">aeepsxtyisi</a> [url=]ueepsxtyisi[/url]


January 22, 2021 10:27 PM

Home | Pariwartan Technologies [url=]ukhgtzgzzl[/url] <a href="">akhgtzgzzl</a> khgtzgzzl


February 8, 2021 10:38 AM

Home | Pariwartan Technologies xpcwqbhbz <a href="">axpcwqbhbz</a> [url=]uxpcwqbhbz[/url]

Leave a reply

your email address will not be published. required fields are marked *

Name *