Skip to content

Choose a Target

PAM keeps PHP in memory, and that foundation powers several kinds of applications: HTTP APIs and web apps, Laravel, native mobile apps and native desktop apps. They share the same pam command and the same PHP 8.5 runtime, but each target has its own template, its own development loop and its own maturity.

Pick a target by what you need to ship, then check its current boundary in the table below before you commit to it.

You want to build Create it with Then run Current boundary
A minimal service on the bare runtime pam init my-service --template raw pam dev index.php Linux x86_64/ARM64 and macOS hosts.
A JSON API pam init my-api --template api pam dev index.php Nimbus 0.7 on the server runtime.
A web app with login pam init my-app --template web pam bin/migrate, then pam dev index.php Nimbus views, sessions and authentication.
A Laravel application pam init my-app --template laravel pam dev pam.php Laravel 13 skeleton; one request per worker.
Real-time features Add --socket to api (or laravel) as above Native WebSocket transport on the same listener.
A native mobile app pam init my-app --template native-ui pam dev Android API 26–36; iOS through a generated UIKit host.
A desktop app pam init my-app --template desktop pam desktop dev Linux is the reference; macOS and Windows are still being validated.
Server, mobile and desktop together pam init my-product --template product see its README.md One workspace with a shared contracts package.

Run pam or pam new without arguments for a guided choice. In scripts, --no-interaction falls back to the API template when you omit --template.

Choose the server runtime when you want a persistent HTTP service: APIs, streaming responses and Server-Sent Events, WebSockets, background tasks and high-throughput I/O, all in PHP and Composer. You have three starting points:

  • raw gives you one index.php and the HTTP Server contract, with no framework and no Composer dependencies. Good for small services and for learning how PAM works.
  • api gives you Nimbus: routing, controllers, validation, resources, the Arcano ORM and in-memory tests. This is the recommended start for most services. --template http is an alias.
  • web extends the API layout with server-rendered views, sessions, translations, a SQLite database and complete login, registration and password-reset screens.
Terminal window
pam init my-api --template api --socket
cd my-api
pam dev index.php

Server hosts are Linux and macOS. On Windows, use WSL 2. See Installation and Compatibility.

Choose Laravel when you want the Laravel application model and its ecosystem. The template creates a regular Laravel 13 skeleton plus a pam.php entry point. PAM boots the framework once per worker and gives each request an isolated application sandbox. Because Laravel’s managers and facades are process-global, each worker runs one request at a time; you scale with more workers (pam start pam.php --workers 8).

Terminal window
pam init my-app --template laravel
cd my-app
pam dev pam.php

If you already use Laravel Octane, PAM can also be its server. The Laravel section covers both paths.

Choose PAM Native when you want a mobile app with real platform controls while application state and composition stay in PHP. It is not a WebView and it does not embed a JavaScript runtime.

Terminal window
pam init my-app --template native-ui --platform all
cd my-app
pam dev

native-ui starts from the official component library; native starts from the lower-level core. Useful options are --platform android|ios|android-tv|all, --starter blank|tabs|auth|ecommerce|chat|showcase, --name and --application-id. Change targets later with pam add target ios or pam remove target android-tv.

Start with the PAM Native overview.

Choose PAM Desktop to write desktop applications in PHP. Components, state and styles are rendered by a Rust host into real platform views: GTK 4 on Linux, AppKit on macOS and Win32 with Direct2D on Windows. There is no Electron and no web view in the rendering path.

Terminal window
pam init my-app --template desktop
cd my-app
pam composer install
pam desktop init
pam desktop dev

Linux is the reference backend. macOS has been run in a virtual machine, and the Windows backend has not yet run on real hardware. Check the Desktop overview for the current status of each platform before you plan a release.

The product template creates one workspace with three independently runnable applications (server, native and desktop) and a local packages/contracts package that all three share:

my-product/
├── apps/
├── packages/
├── pam.json
└── README.md

Use it when the same domain types must flow through an API, a mobile app and a desktop app. Its README.md lists the commands for each application.