Skip to content
Scatlion
Web Development

Laravel commands

A list of most useful Laravel commands

2 min read
On this page

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.

TEXT
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.

TEXT
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.

TEXT
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.

TEXT
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.

TEXT
php artisan route:clear

Clear view cache

Removes all compiled Blade templates. Laravel will automatically recompile the templates the next time they are rendered.

TEXT
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.

TEXT
php artisan optimize:clear