Execute standard caching and optimization Artisan commands during production CI/CD deployment scripts.
Deploying Laravel applications without caching routes, views, and configuration degrades performance. Run this standard production optimization command sequence during deployment.
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache
php artisan queue:restart
- migrate --force runs database migrations without interaction prompts
- config:cache, route:cache, and view:cache pre-compile core assets
- queue:restart signals background workers to reload updated code
Related Tips
View all tips →Monitor Aggregate Queue Metrics with Total Size Helpers in Laravel 13.27
Laravel 13.27 adds totalPendingSize(), totalDelayedSize(), and totalReservedSize() to the Queue facade, making it easy to aggregate queue metrics for dashboards and health checks.
Centralized Queue Routing with Queue::forward() in Laravel 13.26
Laravel 13.26 introduces Queue::forward() to reroute queued jobs to new queue names, different connections, or both without modifying job classes or dispatch sites.