Installation
This page is the reference for adding the SDK to a Laravel application. For a guided run from an empty directory to a working shell, follow the Quickstart.
Requirements
- PHP 8.4 or higher
- Laravel 13
- An SDK licence — it entitles an installation to
laravelui5/sdk; your install token identifies that installation to the registry - A database
- A login: SDK apps run for authenticated users, so the host needs a
loginroute —laravelui5/author your own
Core and OData are installed automatically as dependencies.
1. Configure the package registry
The SDK is distributed via the private registry at packages.pragmatiqu.io — the same one Core comes from, so if Core is already installed this step is done. Let Composer register it:
composer config repositories.pragmatiqu composer https://packages.pragmatiqu.ioUse the command rather than editing composer.json by hand. Composer writes the entry as a named block and keeps that shape as you add repositories later — including the path repository each scaffolded UI5 app needs:
"repositories": {
"pragmatiqu": {
"type": "composer",
"url": "https://packages.pragmatiqu.io"
}
}Composer accepts a second shape here, a plain list. Both are valid, but the section holds one value or the other, so mixing them is the one way to get this wrong: the second write replaces the first and takes the registry with it, and you find out one command later when Composer cannot find laravelui5/sdk at all.
2. Authenticate
Use Composer's HTTP-Basic credential store to bind your install token to the registry:
composer config --global http-basic.packages.pragmatiqu.io [email protected] YOUR-INSTALL-TOKENThe token is the password; the username is the email on your account. This is the command the portal hands you with both halves filled in, the moment you mint a token — copy it rather than retyping it.
Reading the docs is free. Installing the SDK needs a licence: buying it creates a new installation, and a token minted on that installation installs both laravelui5/core and laravelui5/sdk. A token from your free Core installation does not reach the SDK, so mint a new one on the SDK installation. Same credential shape as Core — what differs is what the installation is entitled to pull.
3. Install the SDK
composer require laravelui5/sdk
composer require laravelui5/chiron --dev # optional: guidelines for your coding agentThis pulls in Core and OData automatically.
The second line is optional and dev-only. laravelui5/chiron ships the guidelines and Agent Skills that Laravel Boost hands your coding agent, so it writes this stack instead of guessing at it. It takes one opt-in tick during php artisan boost:install — a scripted install takes nothing without it.
Keep laravel/tinker out of production
Laravel's skeleton lists laravel/tinker under require, so it lands on your production server. Move it to require-dev before the first deployment and install production with composer install --no-dev:
composer remove laravel/tinker
composer require --dev laravel/tinkerA REPL on production lets anyone with a shell change records past every action, every authorization check and the audit. Fix data in production through an action or a command, never by hand. See Deployment.
4. Set up Core
If Core is already running in this application, skip to step 5. Otherwise do Part 1 of the Core quickstart — swap in the UI5-aware CSRF middleware and publish Core's config and views:
php artisan vendor:publish --tag=ui5-config
php artisan vendor:publish --tag=ui5-viewsThen switch on the SDK's shell. In resources/views/ui5/head.blade.php and foot.blade.php, uncomment the SDK lines:
@includeIfSdk('ui5::head') {{-- in head.blade.php --}}
@includeIfSdk('ui5::foot') {{-- in foot.blade.php --}}5. Configure config/ui5.php
Point the registry, the context factory, both middleware stacks and the artifact resolvers at the SDK. The values are on Configuration.
6. Connect your users to partners
The SDK authorizes partners, not user accounts. Your users table links each login to its partner:
php artisan make:migration add_partner_id_to_users_table --table=userspublic function up(): void
{
Schema::table('users', function (Blueprint $table) {
// unsignedInteger to match sdk_partners.id; unique — one login per partner
$table->unsignedInteger('partner_id')->nullable()->unique()->after('id');
$table->foreign('partner_id')->references('id')->on('sdk_partners')->nullOnDelete();
// Login state, used when the Partners app creates logins for partners
$table->unsignedInteger('login_counter')->default(0);
$table->boolean('is_locked')->default(false);
$table->dateTime('last_login')->nullable();
$table->boolean('must_change_password')->default(false);
});
}partner_id must be unique
A partner holds at most one login, and the SDK's login seam depends on it: forPartner() returns a single record, while locking, resetting a password and deleting are where('partner_id', …) updates. Without the unique index two users rows can point at one partner, and a password reset meant for one person resets both. If you already ran this migration without it, add the index in a follow-up migration — after checking for duplicates.
Your User model implements the SDK's contract with the trait that ships with it:
use LaravelUi5\Sdk\Partners\Contracts\HasPartnerInterface;
use LaravelUi5\Sdk\Partners\Traits\HasPartner;
class User extends Authenticatable implements HasPartnerInterface
{
use HasPartner;
// …
}Make partner_id fillable and cast the four login-state columns — login_counter to integer, is_locked and must_change_password to boolean, last_login to datetime. Keep the status columns out of $fillable: a lock flag should never be mass-assignable from a form. The Quickstart shows the lines.
7. Run the migrations
php artisan migrateThe SDK's migrations load automatically, from laravelui5/sdk-db, the package that ships its tables; every table carries the sdk_ prefix. Who runs them is ui5.migrations — leave it at 'app'. Grant tables enforce explicit valid_from / valid_until timestamps.
8. Write the operator
php artisan ui5:intake --name="Acme GmbH" [email protected]This writes the organisation that runs the installation — the operator, one per host — and, before it, the platform owner's rows the SDK ships. It must run before the first sync. It is idempotent, keyed on the email. --name and --email are required; it prompts for them when you don't pass them, and under --no-interaction their absence is an error. Every other detail stays empty unless you pass it.
When app/Installation.php is missing, the command generates it: the operator's key and the installation's values — country, base currency, time zone, decimal places of prices and percentages. Check the values, change them to match your installation, and commit the file. Every later environment runs ui5:intake against the committed class, so they all carry the same operator key. Installation and Tenant explains the rows and the options.
9. Sync the registry
php artisan ui5:syncSync projects Core's metadata and your modules' declarations into the database catalog, checks the operator and writes the platform owner's rows. It is idempotent, and it runs a readiness check first; ui5:ready runs that check alone and writes nothing.
10. Write the tenant and the first admin
FIRST_CHAIR_PASSWORD='…' php artisan ui5:tenant --operator \
[email protected] --admin-first-name=Alice --admin-name=Berger \
--password-env=FIRST_CHAIR_PASSWORDui5:tenant runs once per database. --operator makes the operator its own tenant; an agency running the app for a customer names the customer with --name or --tenant instead. The command writes the first person who can sign in — the operator's admin, with a login and the roles of the upper levels. Everyone else is seated in the Partners app.
Every database of the installation — development, test, production — is built by these same commands. A seeder is for demo and training data only (The First Seed).
11. Build help and navigation, publish the shell assets
php artisan ui5:help --all
php artisan ui5:nav
php artisan ui5:publishui5:help --allcompiles the help that ships with the apps and builds the search index. The shell loads that index when it starts. Run it again when help documents change.ui5:navcompiles the navigation rail intobootstrap/cache/ui5-nav.php. Run it again after adding an app or changing its route labels.ui5:publishcopies the icon fonts and the default avatar topublic/sdk(the shell bundle is served from the package). Run it again after every SDK update; in CI use--force.
What's next?
- Quickstart — a guided run on a fresh Laravel install
- Configuration — every key you set by hand
- Mental Model — layering, time-aware authorization, one tenant per database