Sometimes we need to cache clear when you change in a configuration file or anything change on the view file after a long time. Laravel cache clear, route clear and view clear are also very important sometimes when something changed withing the project. So the below command will help you to clear cache in Laravel.

Clear Cache

php artisan cache:clear

Clear View Cache

php artisan view:clear

Clear Route Cache

php artisan route:cache

Clear Config Cache

php artisan config:cache

You can also clear cache without command using the route. So you can create a route as like below:

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