In this tutorial, we will learn Laravel 7/6 Clear Cache of Route, View, Config Command


It's a good practice to clear the cache when you change in configuration file or any thing change on view file after long time. 

In this section, this example will help clear cache in laravel 7


Clear Cache:

php artisan cache:clear

Clear Route Cache:

php artisan route:cache

Clear View Cache:

php artisan view:clear

Clear Config Cache:

php artisan config:cache

Or you can clear the cache using route:

Route::get('/clear-cache-all', function() {
    Artisan::call('cache:clear');
  
    dd("Cache Clear All");
});


May this example help you.