Delivery for Laravels
Deploying Laravel means moving an application to a production server safely. It involves setting environment variables, running composer install without dev packages, executing migrations, caching config, routes and views, pointing the web server at the public directory, and keeping queue workers running under a process manager.
Stage: Quality and Deployment · Part of the Laravel roadmap · Last reviewed 19 November 2026
What to learn in Delivery
- Prepare a server with PHP, a web server and the required extensions
- Set production environment values, including APP_KEY and APP_DEBUG false
- Run optimisation commands that cache config, routes and views
- Apply database migrations during a release with the force flag
- Keep queue workers alive with Supervisor and restart them after a deploy
Delivery interview questions
Why must the web root point to the public directory?
The public directory holds index.php and assets. The rest of the project, including .env and source code, sits outside it. Pointing the web server at the project root could expose configuration files and secrets directly over HTTP.
What does php artisan optimize do for production?
It caches configuration, routes, events and views into compiled files, which reduces the work done on each request. After caching config, the .env file is no longer read at runtime, so any changes require a rebuild of the cache.
Where Delivery fits in the Laravel roadmap
Delivery belongs to the Quality and Deployment stage (advanced level). Ship.
Other units in this stage
Back to the full Laravel roadmap