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:
- Open the command prompt or terminal on your computer.
- Navigate to the root directory of your Laravel application.
- Run the following command:
- 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.