Skip to main content
ubuntuask.com

Back to all posts

How to Clear Cache In Laravel?

Published on
3 min read
How to Clear Cache In Laravel? image

Best Tools for Clearing Laravel Cache to Buy in October 2025

1 Laravel: Up & Running: A Framework for Building Modern PHP Apps

Laravel: Up & Running: A Framework for Building Modern PHP Apps

BUY & SAVE
$41.38 $55.99
Save 26%
Laravel: Up & Running: A Framework for Building Modern PHP Apps
2 Mastering the Snowflake SQL API with Laravel 10: A Comprehensive Guide to Data Cloud Integrated Development (Apress Pocket Guides)

Mastering the Snowflake SQL API with Laravel 10: A Comprehensive Guide to Data Cloud Integrated Development (Apress Pocket Guides)

BUY & SAVE
$15.13 $22.99
Save 34%
Mastering the Snowflake SQL API with Laravel 10: A Comprehensive Guide to Data Cloud Integrated Development (Apress Pocket Guides)
3 Laravel Essentials: Tips & Tricks for Developers: Master Laravel with Practical Tips for Every Developer

Laravel Essentials: Tips & Tricks for Developers: Master Laravel with Practical Tips for Every Developer

BUY & SAVE
$5.99
Laravel Essentials: Tips & Tricks for Developers: Master Laravel with Practical Tips for Every Developer
4 Architecture of complex web applications. Second Edition.: With examples in Laravel(PHP)

Architecture of complex web applications. Second Edition.: With examples in Laravel(PHP)

BUY & SAVE
$0.99
Architecture of complex web applications. Second Edition.: With examples in Laravel(PHP)
5 Laravel 7.X : LEARN BASIC LESSONS & BUILD A CRUD APP (PHP Framework)

Laravel 7.X : LEARN BASIC LESSONS & BUILD A CRUD APP (PHP Framework)

BUY & SAVE
$2.99
Laravel 7.X : LEARN BASIC LESSONS & BUILD A CRUD APP (PHP Framework)
6 Consuming APIs in Laravel: Build Robust and Powerful API Integrations For Your Laravel Projects With Ease

Consuming APIs in Laravel: Build Robust and Powerful API Integrations For Your Laravel Projects With Ease

BUY & SAVE
$39.00
Consuming APIs in Laravel: Build Robust and Powerful API Integrations For Your Laravel Projects With Ease
7 Overview Of Laravel PHP Framework: For Other Web Framework Users

Overview Of Laravel PHP Framework: For Other Web Framework Users

BUY & SAVE
$2.99
Overview Of Laravel PHP Framework: For Other Web Framework Users
8 The Laravel Survival Guide: Written & Updated for Laravel 5.3

The Laravel Survival Guide: Written & Updated for Laravel 5.3

BUY & SAVE
$9.99
The Laravel Survival Guide: Written & Updated for Laravel 5.3
+
ONE MORE?

To clear cache in Laravel, you can use the Artisan command php artisan cache:clear. This command will clear all cache data stored in the application. Additionally, you can also clear specific cache types such as route cache, configuration cache, view cache, and compiled views by using the respective Artisan commands php artisan route:clear, php artisan config:clear, php artisan view:clear, and php artisan [clear-compiled](https://studentprojectcode.com/blog/how-to-clear-an-element-inside-an-iframe). By running these commands, you can remove any cached data in your Laravel application and ensure that your application is using the latest updated content.

How to clear Laravel view cache manually?

To clear the Laravel view cache manually, you can run the following command in your terminal:

php artisan view:clear

This command will remove all compiled view files in the storage/framework/views directory. This can be useful if you have made changes to your views and want to see the changes reflected immediately without waiting for the cache to clear automatically.

How to clear cache in Laravel using cache driver?

To clear the cache in Laravel using the cache driver, you can use the cache:clear Artisan command. Here's how you can do it:

  1. Open your terminal.
  2. Run the following command:

php artisan cache:clear

This command will clear the entire cache for your Laravel application. It will clear all stored cache data for the specified cache driver (e.g., file, database, redis, memcached).

After running the command, the cache will be cleared, and your Laravel application will start using fresh data.

How to clear cache in Laravel website manually?

To clear the cache in a Laravel website manually, you can follow these steps:

  1. Open your terminal or command prompt.
  2. Navigate to the root directory of your Laravel project.
  3. Run the following command to clear the application cache:

php artisan cache:clear

  1. Additionally, you can also clear the route cache by running the following command:

php artisan route:clear

  1. If you are using view caching, you can clear the view cache by running the following command:

php artisan view:clear

  1. You can also clear the config cache by running the following command:

php artisan config:clear

  1. After running these commands, your cache should be cleared and your Laravel website should be updated with the latest changes.

Please note that clearing the cache may result in a temporary slowdown in website performance as the cache is rebuilt.

How to clear cache in Laravel development environment?

To clear the cache in Laravel development environment, you can use the following commands in your terminal:

  1. Clearing Configuration Cache:

php artisan config:clear

  1. Clearing Route Cache:

php artisan route:clear

  1. Clearing Compiled Views:

php artisan view:clear

  1. Clearing Application Cache:

php artisan cache:clear

  1. Clearing Compiled Classes:

php artisan clear-compiled

After running these commands, your cache will be cleared and you should see the changes reflected in your Laravel development environment.

How to clear cache in Laravel using command line?

To clear cache in Laravel using command line, you can use the following commands:

  1. To clear application cache:

php artisan cache:clear

  1. To clear configuration cache:

php artisan config:clear

  1. To clear route cache:

php artisan route:clear

  1. To clear view cache:

php artisan view:clear

  1. To clear compiled views:

php artisan view:clear

You can run the above commands in your command line interface to clear cache in Laravel.