Laravel on PAM
PAM runs your Laravel application the way you already write it, but without PHP-FPM. Instead of booting the framework on every request, PAM boots it once per worker process, keeps it in memory, and hands each request a clean, isolated copy of the service container. Your routes, controllers, Eloquent models, queues, and Composer packages stay exactly the same.
You get three things out of that:
- Speed. Configuration, service providers, and routes are loaded once per worker, not once per request.
- One binary. PAM is the HTTP server, the PHP runtime (embedded PHP 8.5), Composer, and the process supervisor. There is no Nginx-to-FPM socket to tune.
- Production operations. Zero-downtime reloads, health and readiness endpoints, Prometheus metrics, worker recycling, and atomic releases are built in.
The Laravel integration has two layers:
| Layer | Ships in | What it does |
|---|---|---|
Pam\Laravel\Application |
The pam binary |
Boots Laravel once, isolates every request, streams responses |
pushinbr/pam-laravel |
Composer package (optional) | State guard, health and metrics routes, OTLP traces, process manifest, deploy and diagnostics commands |
You can run Laravel on PAM with only the first layer. Add the package when you want the production tooling.
Quick Start
Section titled “Quick Start”If PAM is already installed (installation guide), a new Laravel application is one command away:
pam init example-app --template laravelcd example-apppam dev pam.phpThen, in another terminal:
curl http://127.0.0.1:3000/api/ping# {"message":"pong"}pam dev watches your code and reloads the worker when a PHP file, route,
config file, .env, or Composer metadata changes.
How It Works
Section titled “How It Works” ┌──────────────────────── pam start pam.php --workers 4 ──┐client ───▶ │ PAM master (Rust, owns the listening socket) │ │ ├─ worker 1: Laravel booted once ─▶ request sandbox │ │ ├─ worker 2: Laravel booted once ─▶ request sandbox │ │ ├─ worker 3: ... │ │ └─ worker 4: ... │ └─────────────────────────────────────────────────────────┘- The master process owns the port and supervises N worker processes.
- Each worker requires
bootstrap/app.php, bootstraps the HTTP kernel, loads configuration, providers, and routes, then waits for traffic. - For each request the worker clones the booted container into a sandbox, runs the request through the normal Laravel kernel, sends the response, runs terminating callbacks, then throws the sandbox away.
- Each worker serves one Laravel request at a time. You get concurrency by running several workers.
The Request Lifecycle page explains exactly what survives between requests and what does not. Read it before you go to production.
PAM, PHP-FPM, and Octane at a Glance
Section titled “PAM, PHP-FPM, and Octane at a Glance”pam start pam.php --workers 8 --admin-address 127.0.0.1:3010One process tree. Laravel boots once per worker, PAM serves HTTP itself, and
the admin listener exposes /live, /ready, and /metrics.
nginx ──fastcgi──▶ php-fpm pool ──▶ public/index.php (boots Laravel every request)Two services to configure and supervise. Every request pays for the full framework bootstrap.
pam composer require laravel/octane pushinbr/pam-octanepam artisan octane:install --server=pampam octane:startKeep Octane’s own lifecycle, events, tables, and Octane::concurrently(), with
PAM as the server. See Laravel Octane on PAM.
Supported Versions
Section titled “Supported Versions”| Component | Supported |
|---|---|
| Laravel | 12.x and 13.x |
| PHP (embedded in PAM) | 8.5 by default, 8.4 supported |
pushinbr/pam-laravel |
requires PHP ^8.4, Laravel ^12.0 || ^13.0 |
pushinbr/pam-octane |
Laravel Octane 2.19 or newer |
The steps in these docs were verified with PAM 2.2.27, embedded PHP 8.5.13,
Laravel 13.45, and pushinbr/pam-laravel 0.1.49.
Next Steps
Section titled “Next Steps”- Installation: new and existing applications.
- Configuration:
pam.phpoptions and environment variables. - Request Lifecycle: what persists between requests.
- Deploying Laravel: systemd, Docker, Forge, and reloads.