Laravel 9 Clear Cache of Route, View, Config Command Tutorial

10-Apr-2023

.

Admin

Laravel 9 Clear Cache of Route, View, Config Command Tutorial

Today,

In this blog, I will give you an example of laravel 9 clear cache. you will learn laravel 9 clear cache config. This article will give you a simple example of laravel 9 cache clear view. We will look at an example of laravel 9 cache clear config. You just need to do some steps to done laravel 9 cache clear command.

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 command for clear cache from view, route, confirm, etc.

Download Laravel


Let us begin the tutorial by installing a new laravel application. if you have already created the project, then skip following step.

composer create-project laravel/laravel example-app

Clear Cache:

php artisan cache:clear

Clear Route Cache:

php artisan route:cache

Clear View Cache:

php artisan view:clear

Clear Config Cache:

php artisan config:cache

Clear Cache Without Command

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

routes/web.php

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

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

dd("Cache Clear All");

});

It will help you...

#Laravel 9