Clear route, view, config and application cache data in Laravel 5

Clear Route, View, Config and Application Cache data in Laravel 5 kodementor

Sometimes we come into situations like it seems to be everything correct but the application always shows an error. Moreover, after we changed the code, it always renders the same old code again and again. Since I have faced this many times, it is most probably due to cached data. In such case, we need to clear our cache from the application.

Let’s start clearing our cache one by one:

Clear Application Cache

This command is used to clear Application cache files.

Clear View Cache

This command is used to clear Route cache.

Clear Route Cache

This command is used to clear Route cache.

Clear Config Cache

This command is used to clear Config cache.

Clear Compiled Cache

This command is used to clear the compiled classes and services application cache.

Artisan command outside CLI

You can also delete your cache data outside of CLI. For this, you need to use Artisan Facade. For this, we will define routes for each command and execute over HTTP request.

Another thing to remember is that Artisan command can also be executed through Queue which executes in application background.

That is all about clearing cached data in laravel 5. Hope you like the article. Please feel free to send feedback through the comment box below.