Laravel - PHP

Laravel Clear Cache with Artisan Command

Product filters using price

Laravel 10 Clear Cache with Artisan Command

Laravel Clear Cache with Artisan Command

Laravel Clear Cache with Artisan Command tutorial, we’ll cover how to clear various caches in a Laravel application using the artisan command-line interface. Specifically, we’ll learn to clear route cache, Laravel application cache, config cache, view cache, and re-optimize classes. Additionally, we’ll explore alternative methods for removing cache in Laravel without relying on artisan commands.

I’m certain that many of you have encountered situations where changes made in the app are not reflected in the view.

This issue arises due to Laravel’s robust caching mechanism, which serves cached data.

If you’re still experiencing this problem, there’s no need to fret. Allow me to introduce you to some of the top artisan commands for clearing the cache in your Laravel application via the PHP artisan command-line interface.

1. Clear Route Cache in Laravel

Laravel caching system also takes routes in consideration, to remove route cache in Laravel use the given below command:

2. Clear Application Cache in Laravel

Run the following command to clear application cache:

3. Clear Config Cache in Laravel

Run the following command to clear config cache

4. Clear View Cache in Laravel

Run the following command to clean your view cache:

5. Laravel clear cache without artisan

It’s not feasible to access SSH on shared hosting servers for utilizing artisan commands to clear, remove, or delete cache in Laravel. However, there’s another workaround in my repertoire, which involves incorporating the Artisan::call() method within the routes/web.php file using the methods provided below. As you can observe, it’s incredibly straightforward.

As you can see, how much simple is that:

Its your turn to let me know what do you think about this laravel clear cache tutorial.

Thanks for reading

Visited 10 times, 1 visit(s) today

Leave a Reply

Your email address will not be published. Required fields are marked *