---
description: >-
  https://www.itsolutionstuff.com/post/laravel-9-clear-cache-of-route-view-config-event-commandsexample.html
---

# Laravel 9 Clear Cache of Route, View, Config, Event Commands

In this example, we will go over the demonstration of laravel 9 clear cache. This article goes in detail on laravel 9 clear cache config. This article will give you simple example of laravel 9 cache clear view. This example will give you a simple example of laravel 9 cache clear config. Follow below example step of laravel 9 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 bellow 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 cache from view, route, config, etc.

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

1\) Application Cache Clear in Laravel 9

2\) Route Cache Clear in Laravel 9

3\) View Cache Clear in Laravel 9

4\) Config Cache Clear in Laravel 9

5\) Event Cache Clear in Laravel 9

6\) All Cache Clear in Laravel 9

7\) Cache Clear by Route in Laravel 9

**1) Application Cache Clear in Laravel 9**

This command will clean all application cache clear

Clear Cache:

```
php artisan cache:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-cache-clear.png)

**2) Route Cache Clear in Laravel 9**

This command will help to clear cache of routes.

Clear Route Cache:

```
php artisan route:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-route-clear-2.png)

**3) View Cache Clear in Laravel 9**

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

Clear View Cache:

```
php artisan view:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-view-clear.png)

**4) Config Cache Clear in Laravel 9**

This command will help to clear cache of config.

Clear Config Cache:

```
php artisan config:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-config-clear-2.png)

**5) Event Cache Clear in Laravel 9**

This command will help to clear cache of events.

Clear Event Cache:

```
php artisan event:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-event-clear.png)

**6) All Cache Clear in Laravel 9**

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

Command:

```
php artisan optimize:clear
```

![](https://www.itsolutionstuff.com/upload/laravel-9-optimize-clear.png)

**7) Cache Clear by Route in Laravel 9**

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

Read Also: [Laravel 9 Yajra Datatables Example Tutorial](https://www.itsolutionstuff.com/post/laravel-9-yajra-datatables-example-tutorialexample.html)

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

I hope it can help you...

\
