Installation
There are two ways to start: create a fresh Laravel application with
pam init, or add one small entrypoint file to an application you already
have. Either way, your Laravel code does not change. PAM only needs:
- the
pambinary (it includes PHP 8.5 and Composer); and - a
pam.phpfile in the project root that boots Laravel and starts listening.
Installing PAM
Section titled “Installing PAM”Install the binary and check the toolchain:
curl -fsSL https://pamphp.com/install | shpam --versionpam doctorSee the main installation guide for macOS,
Windows, and pinned versions. You do not need a system PHP or Composer: use
pam composer and pam artisan everywhere.
New Applications
Section titled “New Applications”-
Create the project:
Terminal window pam init example-app --template laravelcd example-appPAM downloads the official Laravel skeleton, installs its dependencies, generates
APP_KEY, creates the SQLite database, and runs the default migrations. On top of the stock skeleton it adds:File Change pam.phpThe PAM entrypoint routes/api.phpA stateless GET /api/pingroutebootstrap/app.phpRegisters routes/api.phpand renders JSON errors forapi/*composer.jsonpam:devandpam:startscriptsAdd
--socketto also register PAM’s native WebSocket transport on the same listener. -
Start the development server:
Terminal window pam dev pam.php -
Call the API:
Terminal window curl http://127.0.0.1:3000/api/ping{"message":"pong"}
Existing Applications
Section titled “Existing Applications”Any Laravel 12 or 13 application that boots with php artisan serve can run on
PAM.
-
Install dependencies with PAM’s Composer, from the project root:
Terminal window pam composer install -
Create the entrypoint:
pam.php <?phpdeclare(strict_types=1);use Pam\Laravel\Application;$app = Application::boot(__DIR__);$app->listen(port: (int) (getenv('PAM_PORT') ?: 3000),host: (string) (getenv('PAM_HOST') ?: '127.0.0.1'),options: [// Laravel managers and facades are process-global. PAM keeps one request// active per worker and scales safely with `pam start --workers N`.'maxConcurrentRequests' => 1,'responseStreamQueueCapacity' => 16,'maxResponseBytes' => 256 * 1024 * 1024,'maxResponseChunkBytes' => 1024 * 1024,'exposeErrors' => filter_var(getenv('APP_DEBUG') ?: 'false',FILTER_VALIDATE_BOOLEAN,),],);This is the exact file
pam initgenerates.Pam\Laravel\Applicationis built into thepambinary, so there is nothing torequire. -
Run it:
Terminal window pam dev pam.phpYour existing routes now answer on
http://127.0.0.1:3000. SetPAM_PORTandPAM_HOSTto listen elsewhere. -
Use PAM for Artisan too:
Terminal window pam artisan migratepam artisan route:list
Installing the PAM Laravel Package
Section titled “Installing the PAM Laravel Package”pushinbr/pam-laravel adds production tooling on top of the runtime: a request
state guard, health and metrics routes, OpenTelemetry traces, a process
manifest for queues and the scheduler, deployment commands, and an MCP server.
pam composer require pushinbr/pam-laravelpam artisan pam:install --preset=apiPackage discovery registers Pam\Laravel\PamServiceProvider automatically.
pam:install publishes these files:
| File | Purpose |
|---|---|
config/pam.php |
Package configuration (reference) |
pam.processes.json |
HTTP, queue, and scheduler process manifest |
docker-compose.pam.yml |
Docker Compose starting point |
deploy/pam.service |
systemd unit starting point |
deploy/kubernetes.yaml |
Kubernetes Deployment starting point |
deploy/forge-deploy.sh |
Laravel Forge deployment script starting point |
.pam/laravel.json |
The chosen preset, stored as an integer (api = 1, livewire = 2, inertia = 3, realtime = 4) |
Pass --force to overwrite files you already published.
Then check what still needs attention:
pam artisan pam:check-productionOn a fresh local project this fails environment, debug, and config-cache,
which is expected outside production. See the
Production Checklist.
Running Commands Through PAM
Section titled “Running Commands Through PAM”Use the PAM-prefixed equivalents of the tools you already know:
| Instead of | Use |
|---|---|
composer install |
pam composer install |
php artisan migrate |
pam artisan migrate |
php artisan serve |
pam dev pam.php |
php artisan test |
pam artisan test or pam test |
php-fpm + Nginx |
pam start pam.php --workers N |
pam artisan runs Artisan in PAM’s embedded PHP with a real console identity:
runningInConsole() is true, arguments, standard streams, and exit codes work
normally, and packages register their console commands as usual.