How to Clear Cache In Laravel 8
Hello Friends,
In this tutorial, we are going to learn how to clear route cache, laravel application cache, config cache, view cache and reoptimized class in a Laravel 8 application using artisan command-line interface.
Sometimes we need to clear cache when we change something in configuration files or anything change on view files after long time.
The bellow commands will help you to clear cache in laravel 8
Clear Cache:
php artisan clear:cache
Clear Route Cache:
php artisan route:cache
Clear View Cache:
php artisan view:clear
Clear Config Cache:
php artisan config:cache
You can also clear cache without command using route. so you can create route as like bellow
Route::get('/cache-clear', function() {Artisan::call('cache:clear');dd("cache clear All");});
Hope it will help you.
Thanks.
Comments (0)
Leave a Comment
You need to login to post a comment
Login to Comment