laravel/envoy
Laravel Envoy is a lightweight SSH task runner for defining and executing remote server tasks using a clean Blade-style syntax. Ideal for deployments, running Artisan commands, and other repeatable server automation workflows across multiple hosts.
envoy.php config). No external dependencies beyond PHP and SSH access.deploy, backup, restart-services).php artisan migrate), enabling end-to-end workflows (e.g., "deploy + run migrations").try-catch in Blade tasks).composer install on a server) or complex workflows (e.g., blue-green deployments)?.env files (securely) for SSH credentials.deploy.sh script to envoy.php with Blade syntax.package.json scripts or Laravel’s artisan aliases for easier access."scripts": {
"deploy": "envoy run deploy --servers=production"
}
envoy.php with server definitions (e.g., staging, production).deploy, backup, restart).envoy.php snippet:
<?php
return [
'staging' => [
'hosts' => ['staging.example.com'],
'tasks' => [
'deploy' => [
'run' => [
'cd /var/www/app',
'git pull origin main',
'composer install --no-dev',
'php artisan migrate',
],
],
],
],
];
backup → notify-slack).- name: Deploy
run: php artisan envoy:run deploy --servers=production
deploy task).envoy.php in the repo for version control (aligns with Laravel’s "code as config" philosophy).v1.0 for initial deploy task).envoy:run --verbose for detailed SSH output.timeout in task definitions.chown -R deploy:deploy /var/www).ping server before running commands).| Issue Type | Resolution Path |
|---|---|
| Syntax Errors | Blade templating docs |
| SSH Authentication | Server admin / SSH key management |
| Task Logic Errors | Code review / unit tests for tasks |
| Performance Issues | Parallelize tasks, optimize commands |
envoy:run --servers=all).run with --limit to cap concurrent connections.composer install) locally where possible.How can I help you explore Laravel packages today?