- What is lorisleiva/laravel-deployer used for?
- Laravel Deployer provides preconfigured Deployer recipes and Artisan commands for zero-downtime Laravel deployments. It streamlines atomic releases, rollbacks, shared files, migrations, and server setup so deployment steps are repeatable. It is most valuable when you want a standard Laravel deployment workflow without writing every Deployer task yourself.
- How do I install lorisleiva/laravel-deployer in a Laravel app?
- Install it with Composer and wire its recipe or commands into your Deployer configuration. Adoption is mostly configuration plus a command swap in deploy scripts, not an application-code refactor. Check the package's Composer constraints for Deployer, Laravel, and PHP before adding it to an existing pipeline.
- Which Laravel and PHP versions does laravel-deployer support?
- Verify the package's composer.json constraints and CI matrix for the exact Laravel and PHP versions you run. Because this is a pre-1.0 package, do not assume broad framework support from the README alone. Test the declared matrix in your own staging pipeline, especially if you are on newer Laravel or PHP releases.
- How should I configure laravel-deployer for production deployments?
- Configuration lives mainly in your Deployer host and recipe setup, including shared files, writable directories, and migration behavior. Treat migration settings as production-critical: the 0.3.5 release changed the default once() behavior to run migrations on multiple hosts. Define your lock backend and its failure behavior explicitly, and keep deploy runbooks and CI jobs aligned with that choice.
- How does laravel-deployer handle migrations during deployment?
- Laravel Deployer coordinates migration execution during deployment rather than replacing Laravel's migrator. In v0.3.5, release #208 changed the default so once() migrates on multiple hosts instead of a single host. That makes the coordination lock and its backend availability part of deployment correctness. It does not necessarily make non-transactional DDL resumable, so long backfills and index builds still need operational care.
- Is laravel-deployer safe for multi-host or autoscaling deployments?
- Multi-host deployment is where the package adds the most value, but it is also where risk concentrates. Concurrent pod rollouts can create duplicated execution windows or lock contention if the coordination backend is unavailable or a lock TTL expires mid-migration. Confirm whether the lock fails closed or open, and test that behavior before relying on it in autoscaling environments.
- Can I roll back a deployment with laravel-deployer?
- Atomic releases are designed to let you roll back to a previous release, but database migrations complicate rollback because schema changes may not be reversible. Test the rollback path in staging, including shared files and any migrations that ran during the failed deployment. Keep a documented recovery plan for migrations that cannot be safely reversed.
- How do I test laravel-deployer before using it in production?
- Test the package in a staging environment that mirrors production host count and lock infrastructure. Simulate simultaneous deployments, lock-backend outages, long-running migrations that outlive lock TTLs, and rollback after partial migration. Include these scenarios in CI or release rehearsals so procedural gaps surface before production.
- How is laravel-deployer maintained, and what are the supply-chain concerns?
- Treat this as a pre-1.0, single-maintainer package on the deployment critical path, which is a supply-chain consideration. Pin an exact version such as 0.3.5 and commit the lock file rather than floating on ^0.3. Review behavioral diffs like #208 before upgrading, and track the maintainer's path to 1.0 and release cadence.
- What are alternatives to lorisleiva/laravel-deployer?
- Alternatives include using Deployer directly with your own recipes, Laravel Forge or Envoyer for managed deployments, or custom CI scripts around artisan migrate and release symlinks. Compare them on migration coordination, rollback safety, lock behavior, and maintenance burden. Laravel Deployer is a good fit when its opinionated recipes match your infrastructure and you can pin and test it carefully.