How TO Clear Chache in Laravel By CLI

To clear the cache in Laravel using CLI, you can use the php artisan cache:clear command. This command clears the application cache, including the cache of compiled views, routes, and configuration files.

Here are the steps to clear the cache in Laravel using CLI:

  1. Open the command prompt or terminal on your computer.
  2. Navigate to the root directory of your Laravel application.
  3. Run the following command:
  4. Wait for the command to finish executing. Once it is done, you should see a message confirming that the cache has been cleared.
php artisan cache:clear

You can also clear specific caches using CLI, such as the view cache, route cache, and config cache, by running the following commands:

php artisan view:clear
php artisan route:clear
php artisan config:clear

By clearing the cache, you can ensure that your Laravel application runs smoothly and that any changes you make to the code are reflected immediately.

Leave a Reply

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