laravel:runner-selection
Runner Selection for Laravel Commands
Use Sail when present for environment consistency. Fall back to host tools when Sail is unavailable. Detect once, then stick to the choice for the session.
Detecting Sail
# Best-effort alias; safe in any repo
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
# Is Sail usable?
[ -f ./sail ] || [ -x ./vendor/bin/sail ] && echo "Sail available" || echo "Sail not found"
If Sail is unavailable, use host php, composer, and your local Node (pnpm/npm/yarn). Keep versions aligned with your project.
Command Pairs
Use the left command if Sail is available; otherwise use the right.
sail artisan about|php artisan aboutsail artisan test|php artisan testsail artisan migrate|php artisan migratesail composer install|composer installsail composer require vendor/package|composer require vendor/packagesail pnpm install|pnpm installsail pnpm run dev|pnpm run devsail mysql|mysql(with matching DSN/env)sail redis|redis-cli
Safety Notes
- Never mix hosts: don’t install PHP deps with Composer on host and then run them inside Sail (or vice versa). Pick one runtime per session.
- Prefer non-interactive commands in automations/agents; provide flags instead of prompts.
- Treat DB-destructive commands (
migrate:fresh,down -v) with care.
More from jpcaparas/superpowers-laravel
laravel:routes-best-practices
Keep routes clean and focused on mapping requests to controllers; avoid business logic, validation, or database operations in route files
88laravel:blade-components-and-layouts
Compose UIs with Blade components, slots, and layouts; keep templates pure and testable
88laravel:quality-checks
Unified quality gates for Laravel projects; Pint, static analysis (PHPStan/Psalm), Insights (optional), and JS linters; Sail and non-Sail pairs provided
79laravel:performance-caching
Use framework caches and value/query caching to reduce work; add tags, locks, and explicit invalidation strategies for correctness
76laravel:eloquent-relationships
Define clear relationships and load data efficiently; prevent N+1, use constraints, counts/sums, and pivot syncing safely
75laravel:queues-and-horizon
Operate and verify queues with or without Horizon; safe worker flags, failure handling, and test strategies
74