Commands & Configuration
This page lists every command, class, endpoint, and enum a Laravel application on PAM uses, with its exact signature. Configuration keys and environment variables are listed in Configuration.
PAM CLI
Section titled “PAM CLI”pam init
Section titled “pam init”pam init <directory> --template laravel [--socket] [--no-install]Creates a Laravel application with pam.php, routes/api.php, and pam:dev
/ pam:start Composer scripts.
pam dev
Section titled “pam dev”pam dev pam.phpRuns one worker and restarts it when PHP files, routes, config, .env, or
Composer metadata change. vendor, storage, and bootstrap/cache are not
watched.
pam start
Section titled “pam start”pam start pam.php [options] [-- script arguments...]| Option | Description |
|---|---|
--workers N |
Worker processes |
--max-requests N |
Recycle a worker after about N requests (default 10,000,000; staggered 75–100%) |
--task-workers N|auto |
Background task workers (Octane tasks and ticks; default 0) |
--admin-address IP:PORT |
Health and metrics control plane |
--graceful-timeout MS |
Worker shutdown deadline |
--startup-timeout MS |
Worker readiness deadline |
--restart-backoff MS |
Initial crash-restart delay |
--watchdog-grace MS |
Grace period before a stuck worker is killed |
--php-extension NAME |
Repeatable isolated PHP extension allowlist |
Signals: SIGHUP reloads (new generation, then drain), SIGTERM shuts down.
PHP Settings
Section titled “PHP Settings”Pass php.ini directives before the command:
pam -d memory_limit=512M start pam.php --workers 4pam -c /etc/pam/php.ini artisan migrate --forceOther Commands
Section titled “Other Commands”| Command | Description |
|---|---|
pam artisan <command> |
Artisan with a console identity (runningInConsole() is true, PHP_BINARY is pam) |
pam composer <args> |
Embedded, verified Composer |
pam test |
Run PHPUnit or Pest; prints a JSON summary |
pam doctor |
Validate PHP, Composer, and the runtime |
pam top <admin-url> |
Live runtime metrics |
pam benchmark <url> --requests N --concurrency N |
Throughput and latency |
pam octane:start|status|reload|stop |
Octane on PAM (with pushinbr/pam-octane) |
pam config:check|plan|apply pam.toml |
Declarative process manager |
pam ps, pam stop <name>, pam delete <name> |
Managed applications |
Artisan Commands (pushinbr/pam-laravel)
Section titled “Artisan Commands (pushinbr/pam-laravel)”| Signature | Exit code |
|---|---|
pam:install {--preset=api} {--force} |
2 for an unknown preset |
pam:check-production {--json} |
1 if any check fails |
pam:health |
1 if the database is unreachable |
pam:leaks {--json} |
1 if state violations were recorded |
pam:capacity {--memory-mb=512} {--worker-mb=96} {--reserve-percent=20} |
0 |
pam:process {action} {name?} {value?} |
actions: up, status, restart, stop, scale, logs |
pam:deploy {destination=production} {--rollback} {--local} {--release=} |
1 on failure or failed readiness |
pam:remote {action} {target=production} {--process=} {--instances=} {--release=} {--lines=200} {--json} |
actions: deploy, rollback, status, logs, top, workers, queues, scheduler, scale |
pam:autoscale {process=queue} {--cpu=0} {--p95=0} {--metrics-url=} {--watch} {--interval=15} |
1 on metric or scaling errors |
pam:nightwatch {--install-process} {--json} |
1 until all four checks pass |
pam:compatibility {package?} {--refresh} {--json} |
1 if the registry is unavailable or nothing matches |
pam:migrate-from-octane {--json} |
0 |
pam:forge-script {--output=} |
0 |
pam:mcp |
MCP server on stdio |
pam:deploy treats the destination as a local release when --local is passed
or the destination is an existing directory.
PHP API
Section titled “PHP API”Pam\Laravel\Application
Section titled “Pam\Laravel\Application”Built into the pam binary.
final class Application{ public static function boot(string $basePath): self; public static function create(string $basePath): self; // alias of boot() public function listen(int $port = 3000, string $host = '127.0.0.1', array $options = []): void; public function laravel(): \Illuminate\Contracts\Foundation\Application;}listen() throws LogicException unless maxConcurrentRequests is 1, and
defaults maxResponseBytes to 256 MiB and maxResponseChunkBytes to 1 MiB.
Pam\Laravel\Contracts\LifecycleHook
Section titled “Pam\Laravel\Contracts\LifecycleHook”interface LifecycleHook{ public function beforeRequest(Request $request): void; public function afterRequest(Request $request, Response $response, int $durationNanoseconds): void;}Register with app(\Pam\Laravel\Services\LifecycleManager::class)->register($hook).
Pam\Laravel\Contracts\TelemetryExporter
Section titled “Pam\Laravel\Contracts\TelemetryExporter”interface TelemetryExporter{ /** @param list<\Pam\Laravel\ValueObjects\TelemetrySpan> $spans */ public function export(array $spans): void;}The default binding is Pam\Laravel\Services\OtlpHttpExporter. Rebind it in a
service provider to send spans elsewhere.
Middleware
Section titled “Middleware”| Class | Group | Purpose |
|---|---|---|
Pam\Laravel\Http\Middleware\GuardPersistentState |
web, api |
Rolls back leaked transactions, forgets guards, restores locale, clears facades |
Pam\Laravel\Http\Middleware\ObserveRequest |
web, api |
Metrics, lifecycle hooks, OTLP server span, Server-Timing |
Services
Section titled “Services”All are container singletons: LifecycleManager, ObservabilityRegistry,
StateGuard, TelemetryManager, ProductionChecker, HealthReporter,
ProcessSupervisor, AtomicDeployer, RemoteControlClient,
NightwatchIntegration, Autoscaler, AutoscaleMetricsClient, McpServer
(namespace Pam\Laravel\Services).
Pam\Fork
Section titled “Pam\Fork”\Pam\Fork::beforeFork(callable $callback): void; // once, in the zygote\Pam\Fork::afterFork(callable $callback): void; // in every forked worker\Pam\Fork::isForkedWorker(): bool;HTTP Endpoints
Section titled “HTTP Endpoints”| Endpoint | Served by | Notes |
|---|---|---|
/live, /startup, /ready, /metrics |
--admin-address |
Bearer token required off loopback |
/__pam/health |
pam-laravel | 200 or 503; name pam.health |
/__pam/metrics |
pam-laravel | Optional bearer token; name pam.metrics |
/up |
Laravel | Laravel’s own health route |
Integer Enums
Section titled “Integer Enums”| Enum | Values |
|---|---|
StackPreset |
Api 1, Livewire 2, Inertia 3, Realtime 4 |
RemoteProviderType |
PamCloud 1, Forge 2 |
RemoteAction |
Deploy 1, Rollback 2, Status 3, Logs 4, Top 5, Workers 6, Queues 7, Scheduler 8, Scale 9 |
CompatibilityStatus |
Certified 1, Provisional 2, Incompatible 3 |
PackageCategory |
LaravelFirstParty 1, ApplicationUi 2, DomainTooling 3, DataMediaInfrastructure 4, Observability 5, AuthenticationMultitenancy 6, ApiBackoffice 7, DevelopmentQuality 8 |
All live in Pam\Laravel\Enums.
| Path | Created by |
|---|---|
pam.php |
pam init |
config/pam.php |
pam:install |
pam.processes.json |
pam:install |
.pam/laravel.json |
pam:install |
storage/pam/processes/*.pid, scale.json, autoscale.json |
pam:process, pam:autoscale |
storage/logs/pam/<name>-<n>.log |
pam:process |
storage/pam/compatibility.json |
pam:compatibility |