Страницы · Laravilt
Tenancy Middleware
Middleware and routing for tenancy
Middleware Stack
InitializeTenancyBySubdomain
For multi-database mode:
- Extract subdomain from host
- Check if reserved
- Find tenant by domain/slug
- Initialize tenant database
- Set tenant context
IdentifyTenant
For single-database mode:
- Read tenant from route parameter
- Set tenant context (no database switch)
Route Naming
| Context | Prefix | Example |
|---|---|---|
| Subdomain routes | {panel}.subdomain. | admin.subdomain.dashboard |
| Tenant settings | {panel}.tenant.settings. | admin.tenant.settings.profile |
| Central routes | {panel}. | admin.dashboard |
Multi-Panel Support
php
Checking State
php
Next Steps
- Models - Tenant and Domain models
- Configuration - Configuration options
- Best Practices - Tips and troubleshooting