Skip to content

Laravel on PAM

PAM runs an unmodified Laravel application in a persistent PHP Embed worker. Runtime integration classes live under Pam\Laravel; the pushinbr/pam-laravel package adds production presets, diagnostics, observability, process supervision, and deployment operations.

The goal is bigger than making Laravel answer a benchmark quickly. PAM treats Laravel as a production application platform: boot it once, isolate every request, measure its behavior, supervise its processes, ship atomic releases, scale deliberately, and preserve the framework model teams already know. It is Laravel with a purpose-built runtime underneath it — not Laravel rewritten to fit somebody else’s ecosystem.

Laravel support is a Composer ecosystem product running on the PAM runtime. Install and verify PAM first, create the application, and then install the integration through PAM’s Composer passthrough:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-laravel-app --template laravel
cd my-laravel-app
pam composer require pushinbr/pam-laravel
pam dev pam.php

PAM downloads the official Laravel skeleton, installs its Composer dependencies, runs package discovery, creates the application key, and adds a stateless GET /api/ping route.

The maintained executable contract covers Laravel 12 and current Laravel 13 on PHP 8.5 Embed by default, with PHP 8.4 retained in the compatibility matrix.

The matrix exercises boot, providers, middleware, routing, validation, exceptions, terminating callbacks, Eloquent, authentication, sessions, CSRF, uploads, streamed responses, binary responses, package discovery, and stable memory behavior.

PAM boots bootstrap/app.php, the HTTP kernel, providers, configuration, and routes once. For every request, it clones the application container into a sandbox, points framework managers and scoped services at that sandbox, handles the request, terminates it, flushes request state, destroys the sandbox, and restores the root application.

Application code must still avoid keeping the current request, authenticated user, tenant, response, or transaction in global or static state.

Laravel managers, facades, the router, and third-party packages contain mutable process-global state. PAM therefore enforces one concurrent Laravel request per worker, including Socket callbacks.

Terminal window
pam start pam.php --workers "$(nproc)"

Scale through multiple workers. A native PAM application does not inherit this Laravel-specific concurrency restriction.

Terminal window
pam artisan migrate
pam artisan route:list
pam artisan test
pam artisan queue:work

Queue workers, Horizon, and the scheduler are separate long-running console processes. Supervise them independently from the HTTP worker pool.

For a production-shaped application:

Terminal window
pam composer require pushinbr/pam-laravel
pam artisan pam:install --preset=api
pam artisan pam:check-production

Continue with the production platform.