Laravel Clear Cache of Route, View, Config Command

By : phpicoder Created : February 25, 2021

This tutorial is focused on laravel clear cache of route, view, config command. This article will give you simple example of clear cache of route, view, config. 

We need to clear the cache when you edit the configuration file or change anything on the view file after a long time. So the bellow command will help you clear the cache in Laravel applications.

Sometimes we need to change the name of the route, then it will show the error of the old route, then a clear case will be required.

Clear Cache Using Command

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

Clear Cache Without Command


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

I hope it can help you for how to clear cache in laravel tutorial...