Laravel SDK
The Laravel SDK (flowcatalyst/laravel-sdk, current version 0.27.0) lets a Laravel application use
FlowCatalyst as its identity provider and authorisation layer and talk to the platform’s
control plane: write events through the transactional outbox, declare roles,
permissions, event types and subscriptions in code, verify signed deliveries, and manage platform
objects through a typed client.
What is in the box
Section titled “What is in the box”| Capability | Page |
|---|---|
Sign users in through OIDC, auth middleware, stateless or local-user modes |
Auth |
Roles and permissions as PHP attributes, flowcatalyst:sync, custom permission resolvers |
Permissions |
| Typed client for event types, subscriptions, pools, roles, applications, ingestions, platform config | Control plane |
| Portal identities (a client’s own customers) | Portal |
| Field-worker token verification | Field |
| Outbox: events, dispatch jobs, audit logs, pushes | Outbox |
| Verifying inbound signed deliveries | Webhooks |
| Outbox table requirements per database | Database |
| Test helpers | Testing |
| MCP server for AI agents | MCP |
| Every setting and environment variable | Config |
Requirements
Section titled “Requirements”- PHP 8.1 or later and Laravel 10, 11, 12 or 13 (
composer.json). - For the outbox: MySQL 8.0+, PostgreSQL 12+ or MongoDB 4.4+.
- Optional:
spatie/laravel-permissionif you want roles and permissions mirrored into local tables. - Optional:
ext-sodium(bundled with PHP) to mint push tickets, and to verify EdDSA tokens (see below).
Token algorithms
Section titled “Token algorithms”An OAuth client chooses the algorithm that signs its ID tokens (RS256 by default, EdDSA or
ML-DSA-65), and the platform can sign access tokens with EdDSA too (FC_JWT_ACCESS_TOKEN_ALG; see
Tokens). The Laravel verifiers for access tokens and ID tokens accept RS256 and
EdDSA (Ed25519, also written Ed25519), each only against a JWKS key of the matching type (RSA for
RS256, OKP/Ed25519 for EdDSA). EdDSA verification needs ext-sodium; without it an EdDSA token is
refused. ML-DSA-65 tokens are refused: a client that signs in a Laravel application must use RS256
or EdDSA as its ID-token algorithm. Field-worker tokens stay RS256 only
(Field).
Install
Section titled “Install”The SDK is developed in the platform mono-repo under clients/laravel-sdk. Each release is split to
its own repository, flowcatalyst/laravel-sdk, and tagged vX.Y.Z. It is installed from that
repository’s tags rather than from a package registry. Add the repository to your composer.json
and require a tag:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/flowcatalyst/laravel-sdk" } ], "require": { "flowcatalyst/laravel-sdk": "^0.27" }}composer update flowcatalyst/laravel-sdkphp artisan vendor:publish --tag=flowcatalyst-configThe service provider is auto-discovered. The publish step copies config/flowcatalyst.php into your
application; see Config. Outbox migrations are published separately with
--tag=flowcatalyst-migrations (see Outbox).
Quick start
Section titled “Quick start”Add the connection settings to .env:
FLOWCATALYST_BASE_URL=https://your-instance.example.com
# Service account (client_credentials) for the control plane and syncFLOWCATALYST_CLIENT_ID=your_client_idFLOWCATALYST_CLIENT_SECRET=your_client_secretFLOWCATALYST_APP_CODE=blog
# Sign users in with FlowCatalystFLOWCATALYST_OIDC_ENABLED=trueFLOWCATALYST_NATIVE_LOGIN=trueFLOWCATALYST_OIDC_CLIENT_ID=your_oauth_client_idFLOWCATALYST_OIDC_CLIENT_SECRET=your_oauth_client_secretFLOWCATALYST_OIDC_SCOPE="openid profile email offline_access"Then protect routes the normal Laravel way and call the platform through the facade:
use FlowCatalyst\Facades\FlowCatalyst;
Route::middleware('auth')->get('/dashboard', DashboardController::class);
$eventTypes = FlowCatalyst::eventTypes()->list();Artisan commands
Section titled “Artisan commands”| Command | Purpose |
|---|---|
flowcatalyst:scan |
Find attributed definition classes and cache them (--clear empties the cache first). |
flowcatalyst:sync |
Push roles, event types, subscriptions, connections, pools, principals, processes, scheduled jobs and push rules to the platform. See Permissions. |
flowcatalyst:session-table |
Widen sessions.user_id to a string so the database session driver can store FlowCatalyst principals (--rollback reverts). |
flowcatalyst:verify-signature |
Check a delivery’s timestamp, signature and body against FLOWCATALYST_SIGNING_SECRET. See Webhooks. |
Local development
Section titled “Local development”Run the platform locally with fcdev and point FLOWCATALYST_BASE_URL at it
(http://localhost:8080 by default). If you use the outbox you also need fcdev outbox running,
because the SDK only writes rows; the relay is what forwards them.
Related
Section titled “Related”- Receive webhooks, OIDC login, Permissions in code and Sync definitions show the same tasks next to the other languages.
- Permissions and roles and Tokens explain the model the SDK implements.