Deploy Laravel
Laravel deployment uses PAM’s supervised master/worker model and the generated
pam.php entrypoint. PAM 0.1.35 supports local atomic releases and remote PAM
Cloud or Forge operations in addition to the manual signal flow documented
below.
Build the release
Section titled “Build the release”pam composer install --no-dev --classmap-authoritativepam doctor .Create framework caches only when the deployed environment and configuration strategy make them safe:
pam artisan config:cachepam artisan route:cachepam artisan view:cacheGenerate caches before making the application directory read-only.
Start HTTP workers
Section titled “Start HTTP workers”APP_ENV=production \APP_DEBUG=false \PAM_LARAVEL_STORAGE_PATH=/var/lib/pam \pam start pam.php \ --workers 8 \ --max-requests 1000000 \ --admin-address 127.0.0.1:3010Laravel accepts one request or Socket callback per worker. Tune worker count from CPU, p95/p99 latency, RSS, database capacity, and the blocking behavior of application dependencies.
Supervise console roles
Section titled “Supervise console roles”Run queues, Horizon, and scheduler workers as separate services. They must not share the HTTP worker process.
Give each role explicit restart policy, shutdown timeout, memory limit, log collection, and health monitoring.
Readiness
Section titled “Readiness”Probe the PAM master:
curl --fail http://127.0.0.1:3010/startupcurl --fail http://127.0.0.1:3010/readyThe new generation should boot and warm before traffic moves to it. Observe worker state, generation, request latency, errors, event-loop lag, RSS, and PHP memory.
Reload
Section titled “Reload”Point an atomic current symlink at the new release, then:
kill -HUP <master-pid>PAM starts a new generation and drains the old one. Certificates are also re-read when new workers boot.
An idempotent request may be retried at the edge during turnover. Do not replay a write unless the endpoint uses an idempotency key or another domain-safe replay contract.
Roll back
Section titled “Roll back”Restore the current symlink to the prior release and send SIGHUP again. Retain the old release directory until the new generation is healthy and the rollback window closes.
Managed deployment commands
Section titled “Managed deployment commands”Use the built-in release operations when the environment is configured:
pam deploy /srv/app/releases/20260725-1900 --localpam deploy productionpam status productionpam logs production --lines=200pam rollback productionThe local path performs an atomic release. Remote operations target PAM Cloud or Forge. See PAM Cloud and Forge for provider variables, scaling, security boundaries, and the generated Forge script.
Release verification
Section titled “Release verification”Run the Laravel compatibility and memory contract with the exact intended binary and dependency lockfile:
pam composer install --working-dir=compat/laravel-smokecargo test --test laravel -- --nocapturecompat/laravel-smoke/vendor/bin/phpstan analyse \ -c compat/laravel-smoke/phpstan.neon --no-progressAdd application-specific packages, extensions, database drivers, and request sequences to the release gate.