Production Checklist
Before a Laravel application on PAM takes production traffic, check three
things: the Laravel configuration is production-grade, the runtime is sized and
supervised, and the application is free of persistent-state leaks.
pushinbr/pam-laravel automates the first part with pam:check-production.
Running the Audit
Section titled “Running the Audit”pam artisan pam:check-production+---------------------+--------+------------------------------------------------------------+| Check | Result | Message |+---------------------+--------+------------------------------------------------------------+| environment | FAIL | Set APP_ENV=production. || debug | FAIL | Set APP_DEBUG=false. || app-key | PASS | Application encryption key is valid. || config-cache | FAIL | Run `pam artisan config:cache` during the release build. || route-cache | PASS | Route cache policy is satisfied. || cache-driver | PASS | Cache driver `database` satisfies the deployment policy. || session-driver | PASS | Session driver `database` satisfies the deployment policy. || queue-driver | PASS | Queue driver `database` satisfies the deployment policy. || storage | PASS | Storage is writable. || bootstrap-cache | PASS | /srv/app/current/bootstrap/cache is writable. || composer-lock | PASS | composer.lock is present. || sapi | PASS | Runtime SAPI is `cli`. || extension-ctype | PASS | Extension ctype is loaded. || ... | | |+---------------------+--------+------------------------------------------------------------+The command exits 1 when any check fails, so it can gate a pipeline. Use
--json for machine-readable output.
What Each Check Means
Section titled “What Each Check Means”| Check | Passes when |
|---|---|
environment |
APP_ENV=production |
debug |
APP_DEBUG=false |
app-key |
APP_KEY decodes to the right length for app.cipher |
config-cache |
The configuration is cached (disable with PAM_REQUIRE_CONFIG_CACHE=false) |
route-cache |
Routes are cached, only if PAM_REQUIRE_ROUTE_CACHE=true |
cache-driver |
The cache store is not array, file, or cookie (disable with PAM_REQUIRE_DISTRIBUTED_CACHE=false) |
session-driver |
Same rule for sessions (PAM_REQUIRE_DISTRIBUTED_SESSION=false) |
queue-driver |
The queue is not sync (PAM_QUEUE_SYNC_ALLOWED=true) |
storage |
storage/ is writable |
bootstrap-cache |
bootstrap/cache is writable, or read-only with a cached config (warning) |
composer-lock |
composer.lock exists |
sapi |
The command runs under PAM (pam artisan); a warning otherwise |
extension-* |
Each extension in pam.production.required_extensions is loaded |
The Checklist
Section titled “The Checklist”Application
Section titled “Application”-
pam artisan pam:check-productionpasses. -
pam artisan optimizeruns during the release build. - No per-request data in static properties or boot-time singletons (Request Lifecycle).
-
PAM_LARAVEL_STATE_GUARD_STRICT=truein staging, with no violations. - The persistent smoke test passes against your real routes.
- No
exit()/die()in request code.
Runtime
Section titled “Runtime”- Workers sized from measurement (Performance Tuning).
-
--max-requestschosen from a soak test. -
--admin-addresson loopback or a private network;/readywired to the load balancer. -
php.inivalues you rely on passed withpam -dorpam -c. -
pam.phplimits (maxBodyBytes,maxResponseBytes,requestTimeoutMs) match your largest legitimate request and response. -
trustedProxiesset to your proxy addresses only.
Processes
Section titled “Processes”- HTTP, queue workers, and the scheduler run as separate supervised services (Deploying Laravel).
- Exactly one scheduler per environment.
-
pam artisan queue:restartruns on every deploy.
Operations
Section titled “Operations”- Database and Redis connection limits cover
workers × servers. - Alerts on readiness, error rate, p99, RSS growth, and queue age (Observability).
- A tested rollback: previous release kept, reload verified.
- Secrets (
APP_KEY, tokens,NIGHTWATCH_TOKEN) in a secret store, not in the image or repository.
Runtime Diagnostics
Section titled “Runtime Diagnostics”The PAM CLI checks the runtime itself:
pam doctorand with the package installed:
pam artisan pam:healthpam artisan pam:leakspam artisan pam:capacity --memory-mb=4096 --worker-mb=120pam:health and pam:leaks describe the console process they run in. For live
workers, query /__pam/health and /__pam/metrics over HTTP (see
Observability).
Command Map
Section titled “Command Map”| Task | Command |
|---|---|
| Production audit | pam artisan pam:check-production |
| Health report | pam artisan pam:health |
| Leaks and memory | pam artisan pam:leaks |
| Capacity estimate | pam artisan pam:capacity --memory-mb=2048 --worker-mb=110 |
| Process manifest | pam artisan pam:process up|status|restart|stop|scale|logs |
| Local atomic release | pam artisan pam:deploy /srv/app/releases/<id> --local |
| Remote deploy | pam artisan pam:deploy production |
| Remote operations | pam artisan pam:remote <action> production |
| Nightwatch | pam artisan pam:nightwatch --install-process |
| Package registry | pam artisan pam:compatibility spatie/laravel-permission |
| Queue autoscaling | pam artisan pam:autoscale queue --cpu=80 --p95=400 |
| Forge script | pam artisan pam:forge-script --output=deploy/forge-deploy.sh |
| Octane audit | pam artisan pam:migrate-from-octane |
| MCP server | pam artisan pam:mcp |
Every command is documented in the reference.