Skip to content

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.

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
  • 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-permission if 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).

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

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"
}
}
Terminal window
composer update flowcatalyst/laravel-sdk
php artisan vendor:publish --tag=flowcatalyst-config

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

Add the connection settings to .env:

FLOWCATALYST_BASE_URL=https://your-instance.example.com
# Service account (client_credentials) for the control plane and sync
FLOWCATALYST_CLIENT_ID=your_client_id
FLOWCATALYST_CLIENT_SECRET=your_client_secret
FLOWCATALYST_APP_CODE=blog
# Sign users in with FlowCatalyst
FLOWCATALYST_OIDC_ENABLED=true
FLOWCATALYST_NATIVE_LOGIN=true
FLOWCATALYST_OIDC_CLIENT_ID=your_oauth_client_id
FLOWCATALYST_OIDC_CLIENT_SECRET=your_oauth_client_secret
FLOWCATALYST_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();
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.

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.