How to clear cache in laravel?

Member

by samara , in category: PHP Frameworks , 5 months ago

How to clear cache in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by herminia_bruen , 5 months ago

@samara 

To clear the cache in Laravel, you can use the following Artisan commands:

  1. Clear application cache:
1
php artisan cache:clear


  1. Clear route cache:
1
php artisan route:clear


  1. Clear configuration cache:
1
php artisan config:clear


  1. Clear view cache:
1
php artisan view:clear


  1. Clear compiled files cache:
1
php artisan clear-compiled


  1. Clear all caches:
1
php artisan optimize:clear


You can run these commands in your terminal while in the root directory of your Laravel project to clear the specified cache.