Search by

pushinbr / pam-laravel

DavidWilliamBalbino

Production tooling, lifecycle safety, observability and deployment for Laravel applications running on PAM.

Package info

github.com/push-in/pam-laravel

Issues

pkg:composer/pushinbr/pam-laravel

Statistics

Installs: 814

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.49 2026-08-22 01:17 UTC

README

pam-laravel: Keep Laravel. Replace the disposable runtime underneath it.

Keep Laravel. Replace the disposable runtime underneath it.
Production lifecycle, isolation, observability, queues, and deployment tooling for Laravel 12 and 13 applications running on PAM.

Packagist PHP 8.5 License

Install · Operations · Lifecycle · Releases · Docs · Issues

Install

In a Laravel application on PAM:

pam init my-app --template laravel
cd my-app
pam composer require pushinbr/pam-laravel
pam artisan pam:install
pam artisan pam:check-production

pam:install publishes the configuration and production manifests (--preset=api, livewire, inertia or realtime). The package also registers pam artisan, which runs Laravel Artisan inside PAM's embedded PHP.

Operations

pam artisan pam:health
pam artisan pam:leaks
pam artisan pam:capacity --memory-mb=1024 --worker-mb=96
pam artisan pam:process up
pam artisan pam:process status
pam artisan pam:process restart queue
pam artisan pam:deploy /srv/app/releases/20260725-120000
pam artisan pam:deploy --local --rollback
pam artisan pam:remote status production
pam artisan pam:nightwatch
pam artisan pam:autoscale queue --cpu=80 --p95=400
pam artisan pam:mcp

The default endpoints are:

  • GET /__pam/health for readiness and liveness;
  • GET /__pam/metrics for bounded process telemetry.

Set PAM_LARAVEL_OBSERVABILITY_TOKEN to require a bearer token on metrics. The registry retains bounded route, query and state-violation data, preventing the observability layer itself from becoming a memory leak.

Production lifecycle

PAM Laravel adds a request state guard to the web and api middleware groups. It rolls back leaked transactions, forgets authenticated users, restores the process locale and clears resolved facades after every request. Use strict mode in CI to turn detected state leakage into a failed request:

PAM_LARAVEL_STATE_GUARD=true
PAM_LARAVEL_STATE_GUARD_STRICT=true

Application-specific cleanup can implement Pam\Laravel\Contracts\LifecycleHook and register it with LifecycleManager.

Role Framework integration
This repository owns Laravel boot, request isolation, cleanup, diagnostics, and production commands
Boundary Laravel conventions and its package ecosystem remain Laravel

Zero-downtime releases

Prepare an immutable release inside PAM_DEPLOY_ROOT, run migrations and framework cache generation in the release, then activate it with pam:deploy. Activation uses an atomic symlink replacement and records the previous target for rollback. Destructive schema changes should follow expand/migrate/contract deployment discipline.

Process manifest

pam.processes.json represents commands as arrays, not shell strings. This keeps arguments unambiguous and avoids manifest command injection:

{
  "processes": {
    "http": {
      "command": ["pam", "start", "pam.php", "--workers", "2"],
      "instances": 1
    }
  }
}

PAM's Laravel runtime remains conservative about request concurrency because Laravel applications and third-party packages can hold mutable process-global state. Scale with multiple isolated workers; certify lifecycle hooks under load before opting into more aggressive concurrency.

Support policy

The compatibility matrix tests PHP 8.4 with the maintained Laravel 12 release and the current Laravel 13 release. The public compatibility registry lives in the main PAM repository.

See the full production platform guide for OTLP traces, Nightwatch, PAM Cloud and Forge operations, autoscaling, MCP, package certification and reproducible benchmarks.

Docs

Part of the PAM ecosystem

PAM

PAM runs PHP natively on servers, desktops and phones. This repository is one piece of it.

PAM PAM Desktop PAM Native Ecosystem
the runtime and CLI native desktop apps in PHP native Android and iOS apps in PHP every official package and plugin

Docs: push-in.github.io/pam-docs · Issues

MIT License · Made in Brazil by Pushin