الصفحات · Laravilt
Tenant Models
The Tenant and Domain models used by multi-database tenancy.
Tenant Model
Laravilt\Panel\Models\Tenant lives in the central database. It uses string (non-incrementing) keys and soft deletes.
php
With the default provisioning config, creating a tenant creates and migrates its database. The php artisan tenant:create command does the same from the CLI.
Attributes
| Attribute | Type | Description |
|---|---|---|
id | string | Primary key |
name | string | Display name |
slug | string | URL/subdomain identifier |
email | string | Contact email |
avatar, description | string | Profile data |
owner_id | int | Owner user id |
database | string | Database name |
data, settings | array | Arbitrary data and settings |
trial_ends_at | datetime | Trial end |
Methods
php
Domain Model
php
Getting the Current Tenant
php
The facade also provides setTenant(), getTenantId(), getTenants(), canAccessTenant() and isTenancyEnabled().