Create your first app
Create an API project and start its development server:
pam init hello-pam --template httpcd hello-pammkdir -p storage && touch storage/database.sqlitepam composer migratepam dev index.phpThe generated project exposes GET /api/ping on port 3000.
curl http://127.0.0.1:3000/api/ping{"data":{"status":1,"message":"pong","requestId":null}}This is already a persistent PHP application. PAM loaded the Composer autoloader and application once; subsequent requests execute inside isolated Fibers.
The starter is structured from its first route: PingController::show
orchestrates ReadinessService, returns a readonly snapshot through
PingResource, and represents readiness with a sequential integer-backed enum.
index.php validates typed port configuration and enables security headers
before the listener starts.
pam composer testThe generated test invokes the same named action through PAM API’s in-memory
client and asserts the Resource envelope and request ID. It also executes a
complete SQLite/Eloquent create-and-list flow through named
ProductController::store and ProductController::index actions, Form Request,
DTO, service, repository and Resource. Product creation returns 201 Created;
its status is transmitted as sequential integer enum value 1.
What pam init does
Section titled “What pam init does”The initializer creates a normal Composer project, selects the first-party packages required by the preset, and installs them using Composer inside PAM’s Embed SAPI. There is no PAM-specific dependency lockfile.
Use --no-install when you want source generation without dependency resolution:
pam init hello-pam --template http --no-installThe structured starter installs the published PAM HTTP 2 line directly from
Packagist. Use --no-install only when you intentionally want to inspect or
modify the generated sources before Composer resolves dependencies.
Add WebSockets
Section titled “Add WebSockets”The socket preset enables PAM’s native WebSocket transport on the same listener:
pam init realtime-api --template http --socketBuild the product you came for
Section titled “Build the product you came for”The same project workflow drives every PAM target:
| Product | Create it | First visible result |
|---|---|---|
| Persistent HTTP | pam init my-api --template http |
JSON endpoint on port 3000 |
| Laravel | pam init my-app --template laravel |
Warm Laravel route and working Artisan |
| Native mobile | pam init my-app --template native |
Real Android/iOS controls with hot reload |
| Native UI | pam init my-app --template native-ui |
Retained Material Design 3 screen |
| Desktop | pam init my-app --template desktop |
Capability-secured native window |
pam doctor → pam dev → pam test → pam build → pam packageChoose one explicitly:
pam init my-laravel-app --template laravelpam init native-core --template nativepam init native-ui --template native-uipam init my-desktop-app --template desktopRun pam without arguments for the guided launcher. Inside any generated
project, prefer the contextual workflow: pam doctor, pam dev, pam test,
pam build, and pam package.
Read Choose a target for the exact platform contracts. Use the CLI & project console as the command reference for daily development, automation, Composer, Artisan, generators, and releases.
When the product needs maps, authentication, offline sync, video, payments, observability, hardware, or platform services, continue in the capability catalog.