Skip to content

How to Clear cache in Laravel 5

Last updated on February 17, 2018

Here I am gonna show you few artisan commands which will help you to clear different caches in your Laravel application.

Clear Application Cache

To clear application cache use the `php artisan cache:clear` command.

php artisan cache:clear

Generally we don’t get access to SSH on shared hosting plans, where we can do something like below shown, place below code in your routes/web.php file and access it just like another URL of your application.

Route::get('/clear-cache', function() {
    Artisan::call('cache:clear');
    return "Cache is cleared";
});

Clear route cache

To clear route cache of your Laravel application issue below command from terminal.

php artisan route:cache  

Clear config cache

To clear config cache of your Laravel application issue below command from terminal.

php artisan config:cache  

Clear compiled view files

To clear compiled view files of your Laravel application issue below command from terminal.

php artisan view:clear 
0 0 votes
Article Rating
Subscribe
Notify of
guest

2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments