Skip to content

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.

Terminal window
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.

Terminal window
pam dev pam.php

Runs one worker and restarts it when PHP files, routes, config, .env, or Composer metadata change. vendor, storage, and bootstrap/cache are not watched.

Terminal window
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.

Pass php.ini directives before the command:

Terminal window
pam -d memory_limit=512M start pam.php --workers 4
pam -c /etc/pam/php.ini artisan migrate --force
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
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.

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.

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).

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.

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

All are container singletons: LifecycleManager, ObservabilityRegistry, StateGuard, TelemetryManager, ProductionChecker, HealthReporter, ProcessSupervisor, AtomicDeployer, RemoteControlClient, NightwatchIntegration, Autoscaler, AutoscaleMetricsClient, McpServer (namespace Pam\Laravel\Services).

\Pam\Fork::beforeFork(callable $callback): void; // once, in the zygote
\Pam\Fork::afterFork(callable $callback): void; // in every forked worker
\Pam\Fork::isForkedWorker(): bool;
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
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