How to Clear Cache in Laravel 8 with artisan commands

In this tutorial you will learn about the How to Clear Cache in Laravel 8 with artisan commands and its application with practical example.

In this tutorial, I’ll show you how to clear cache in laravel 8. We will learn to clear laravel cache of different types example: view cache, application cache, route cache, config cache etc. I’ll show you various laravel artisan commands to clear laravel 8 cache of different types. You will also learn to clear cache on shared hosting without artisan commands.

In Laravel, while developing a laravel application it is very often that changes we made are not reflecting. This is usually happens because of the laravel cache. Laravel provides various caching systems for developing fast loading laravel applications.

In this laravel clear cache example, we will learn to clear cache from command line (CLI), we will see how to clear cache from blade (views), routes,config etc using the command line and artisan command.

Laravel 8 Clear Cache Artisan Commands

Here, we will discuss about various artisans commands used to clear different laravel cache in laravel applications.

How to clear laravel App Cache

To clear laravel application cache use the php artisan cache:clear artisan command as given below :

How to clear laravel route Cache

To clear route cache in laravel use the php artisan route:clear artisan command as given below :

How to clear laravel config cache

To clear config cache in laravel use the php artisan config:cache artisan command as given below :

How to clear laravel View Cache

To clear compiled view files cache in laravel use the php artisan view:clear artisan command as given below :

Laravel Reoptimized Class

Use the following laravel command to Reoptimized Class In laravel :

Clear Cache On Shared Host Without Artisan Commands

In shared hosting servers typically we don’t have SSH access to the server. In that case, to clear laravel 8 cache we have define routes in our application’s routes/web.php file that invoke the various laravel clear cache commands. This way we can clear Laravel cache by accessing specific routes in the browser.

How to Clear Route Cache from Browser

How to Clear Config Cache from Browser

How to Clear Application Cache from Browser

How to Clear View Cache from Browser

In this tutorial we have learn about the How to Clear Cache in Laravel 8 with artisan commands and its application with practical example. I hope you will like this tutorial.