Skip to content

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.

Terminal window
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.

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
  • pam artisan pam:check-production passes.
  • pam artisan optimize runs during the release build.
  • No per-request data in static properties or boot-time singletons (Request Lifecycle).
  • PAM_LARAVEL_STATE_GUARD_STRICT=true in staging, with no violations.
  • The persistent smoke test passes against your real routes.
  • No exit()/die() in request code.
  • Workers sized from measurement (Performance Tuning).
  • --max-requests chosen from a soak test.
  • --admin-address on loopback or a private network; /ready wired to the load balancer.
  • php.ini values you rely on passed with pam -d or pam -c.
  • pam.php limits (maxBodyBytes, maxResponseBytes, requestTimeoutMs) match your largest legitimate request and response.
  • trustedProxies set to your proxy addresses only.
  • HTTP, queue workers, and the scheduler run as separate supervised services (Deploying Laravel).
  • Exactly one scheduler per environment.
  • pam artisan queue:restart runs on every deploy.
  • 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.

The PAM CLI checks the runtime itself:

Terminal window
pam doctor

and with the package installed:

Terminal window
pam artisan pam:health
pam artisan pam:leaks
pam artisan pam:capacity --memory-mb=4096 --worker-mb=120

pam:health and pam:leaks describe the console process they run in. For live workers, query /__pam/health and /__pam/metrics over HTTP (see Observability).

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.