Laravel Artisan Cache Clearing Commands
Clear config cache
Removes the cached configuration file. Run this command after making changes to the .env file or any configuration files in the config directory if the configuration is cached.
php artisan config:clear
Clear application cache
Removes all cached data from the default cache store. Useful when you want to invalidate cached database queries, API responses, or any other data stored using Laravel's cache system.
php artisan cache:clear
Clear compiled files
Removes the compiled service and package manifest files. Useful when experiencing issues with service providers or package discovery.
php artisan clear-compiled
Clear event cache
Removes the cached event and listener mappings. Run this command after making changes to events or listeners if events are cached.
php artisan event:clear
Clear route cache
Removes the cached route definitions. Run this command after adding, modifying, or removing routes if routes are cached.
php artisan route:clear
Clear view cache
Removes all compiled Blade templates. Laravel will automatically recompile the templates the next time they are rendered.
php artisan view:clear
Clear all caches
Runs all six built-in commands described above at once. Useful when troubleshooting caching issues or when you want to clear all cached optimization files and application cache.
php artisan optimize:clear