Skip to content
Packstub

Filament Tenancy

Multi-database tenancy for Filament v5 panels, powered by stancl/tenancy v4. One login on your central domain, a workspace per tenant on its own subdomain or custom domain, and every tenant on its own database — no tenant_id columns, no global scopes. Scale across any number of database servers when you need to.

Creating a workspace from the tenant menu: its own database is provisioned in the waiting room and the panel opens on its own subdomain

  • Installation — add the registry, require the package, run the installer, register the plugin. Five minutes.
  • Quickstart — create your first tenant through the onboarding wizard and land in its panel.
  • Adopting an existing app — already have a Team model and team_id columns? One command keeps them and makes every team a tenant.
  • Live demo — two provisioned tenants, each on its own database; the login is pre-filled. Source on GitHub.

What you get

Feature What it means for you
One plugin line ->plugin(TenancyPlugin::make()) wires the tenant model, routing, switcher, onboarding wizard, and provisioning status page. No stancl middleware to add.
Isolated by connection Tenant tables live in the tenant's database. Your models and resources stay exactly as in a single-tenant app.
Queued provisioning Create database → migrate → seed → ready, with a polling status page and one-command retry.
Custom domains DNS verification and single-origin login handoff, so app.acme-corp.com works with one line of config.
Horizontal scaling A database pool spreads tenant databases across servers; add a server, add capacity.
Shared or dedicated Database-per-tenant, shared tenant_id scoping (optionally PostgreSQL RLS), or both — per app, even per tenant.
Drops into an existing app tenancy:adopt keeps your Team model, bigint ids, pivot and team_id columns; every existing team becomes a live tenant.

Guides

Guide What it covers
Installation Registry setup, the interactive installer, the User model and panel wiring
Quickstart Your first tenant: the onboarding wizard, provisioning, and the tenant panel
Adopting an existing app tenancy:adopt: keep your tenant model, pivot and tenant key columns (team_id), scale to shards later
How it works The isolation model, request identification, and the provisioning pipeline
Configuration Complete reference: the annotated config file, the fluent TenancyPlugin API, and stancl's config
Database strategies Dedicated (database-per-tenant), shared (tenant_id, shards, optional PostgreSQL RLS), and hybrid
Custom domains Tenant-owned domains: DNS verification, cross-domain sign-in handoff, logout-everywhere
Horizontal scaling The database pool: spreading tenant databases across multiple servers
Resource syncing Keeping central and tenant copies of a resource in sync
Customizing the UI Publishing views and translations: restyle the waiting room, add a locale
Testing Test helpers and patterns for tenant-aware test suites
Production Queues, Octane, backups, and the go-live checklist
Troubleshooting Common failure modes and how to recover from them

Requirements

PHP 8.4+, Laravel 13, Filament 5. Tenant databases on SQLite, MySQL, MariaDB, PostgreSQL, or SQL Server. stancl/tenancy v4 is installed automatically from the Packstub registry — details.

Help


These pages are published at packstub.dev/docs/filament-tenancy and mirrored read-only on GitHub from the package's docs/ directory. Spotted a mistake? Email [email protected].

You're on the list.

We'll email you when Filament Tenancy has a new release.