Reference application
examples/laravel-saas-api is a deliberately small Laravel 13 application that
demonstrates PAM’s production layout without hiding domain code behind a demo
framework.
It includes:
- a real migration and Eloquent model;
- an integer-backed domain enum;
- a repository for persistence and reusable queries;
- a service for the use case;
- a Form Request for validation;
- an API Resource for the response contract;
- a thin controller; and
- endpoint feature tests.
Start it
Section titled “Start it”From the PAM repository:
cd examples/laravel-saas-apicp .env.example .envtouch database/database.sqlitecomposer installpam artisan key:generatepam artisan migratepam artisan pam:install --preset=apipam dev pam.phpCreate and list workspaces:
curl -X POST http://127.0.0.1:3000/api/workspaces \ -H 'Content-Type: application/json' \ -d '{"name":"Community"}'
curl http://127.0.0.1:3000/api/workspacesProduction uses:
pam start pam.php --workers NQueue and scheduler roles come from the process manifest published by
pam:install.
Architecture
Section titled “Architecture”HTTP request └─ Form Request └─ thin controller └─ application service └─ repository └─ Eloquent model / database └─ API Resource └─ JSON responseThe controller only orchestrates the request and response. Business rules live in the service. Persistence and reusable Eloquent queries live in the repository. Domain statuses and types are sequential integers represented by PHP enums rather than string magic values.
Reference versus compatibility fixture
Section titled “Reference versus compatibility fixture”Use examples/laravel-saas-api as readable code to copy and extend.
Use compat/laravel-smoke to investigate the broad executable contract. It is
intentionally dense and exercises Blade, Livewire, Inertia, Sanctum, Scout,
Reverb discovery, uploads, queues, scheduler, cache, databases, Telescope, and
Pulse under persistent workers.