Pages · Laravilt
Tenancy Overview
Choose between single-database and multi-database tenancy and enable it on a panel.
Build SaaS applications with tenant isolation.
Tenancy Modes
| Mode | Description | Routing |
|---|---|---|
| Single database | Shared database, records scoped to a tenant | Path: /admin/{tenant}/... |
| Multi-database | Separate database per tenant | Subdomain: {tenant}.myapp.com/admin/... |
Single-Database Mode
php
Resources are scoped to the current tenant automatically. See Teams Tenancy for the full setup.
Multi-Database Mode
Publish the config and migrations for the central tenants, domains and tenant-user tables:
bash
php
Manage tenants from the command line:
bash
| Command | Options |
|---|---|
tenant:create {name} | --slug=, --email=, --domain=, --no-database, --no-migrate, --seed |
tenants:migrate | --tenant=, --fresh, --seed, --seeder=, --force |
tenant:delete {tenant} | --force, --keep-database |
When to Use Each Mode
Single database:
- Small to medium apps
- Minimal database overhead
- Tenants may share some data
Multi-database:
- Strict data isolation
- Compliance requirements
- Per-tenant backups or scaling
Next Steps
- Teams Tenancy: teams as tenants
- Configuration: detailed configuration