Laravel 10 Clear Cache of Route, View, Config, Event Commands

By Hardik Savani November 5, 2023 Category : Laravel

Hey,

This post will give you an example of laravel 10 clear cache. you can understand a concept of laravel 10 clear cache config. if you want to see an example of laravel 10 cache clear view then you are in the right place. you can understand a concept of laravel 10 cache clear config. you will do the following things for laravel 10 cache clear command.

Sometimes we need to cache clear when you change in a configuration file or anything changes on the view file after a long time. so the below command will help you to clear cache in laravel 8.

I want to share my experience and solution. when I was working on my laravel e-commerce website with GitLab. I was fetching one issue suddenly my view cache with an error during development. I did try a lot to refresh and something other but I can't see any more change in my view, but at last, I did resolve my problem using the laravel command so, let's see I added several commands for clear the cache from view, route, config, etc.

Let's see the list of commands for clearing cache in laravel 10. I will give you command with output:

1) Application Cache Clear in Laravel 10

2) Route Cache Clear in Laravel 10

3) View Cache Clear in Laravel 10

4) Config Cache Clear in Laravel 10

5) Event Cache Clear in Laravel 10

6) All Cache Clear in Laravel 10

7) Cache Clear by Route in Laravel 10

1) Application Cache Clear in Laravel 10

This command will clean all application cache clear

Clear Cache:

php artisan cache:clear

2) Route Cache Clear in Laravel 10

This command will help to clear cache of routes.

Clear Route Cache:

php artisan route:clear

3) View Cache Clear in Laravel 10

This command will help to clear cache of views/blade files.

Clear View Cache:

php artisan view:clear

4) Config Cache Clear in Laravel 10

This command will help to clear cache of config.

Clear Config Cache:

php artisan config:clear

5) Event Cache Clear in Laravel 10

This command will help to clear cache of events.

Clear Event Cache:

php artisan event:clear

6) All Cache Clear in Laravel 10

This command will help to clear cache of config, views, cache files etc.

Command:

php artisan optimize:clear

7) Cache Clear by Route in Laravel 10

You can also clear cache without command using route. so you can create route as like bellow:

Route::get('/clear-cache-all', function() {

Artisan::call('cache:clear');

dd("Cache Clear All");

});

I hope it can help you...

Shares