Basic Usage Guide
This section will guide you through basic operations with Filament Tenancy, including tenant creation, user management, working with models, and middleware configuration.
Contents
Section titled “Contents”- Create Tenants - Learn to create and manage tenants
- Manage Users - Create users with roles and permissions
- Working with Models - Use traits and models from the package
- Middleware and Security - Configure and understand security middleware
Key Concepts
Section titled “Key Concepts”Tenants
Section titled “Tenants”A tenant is an independent instance of your application with:
- Its own database
- Its own users, roles, and permissions
- Its own domain or subdomain
- Complete isolation from other tenants
Tenant Context
Section titled “Tenant Context”The package automatically switches the database context based on the domain from which access is made. This allows each tenant to have completely separated data.
Tenant Resolution
Section titled “Tenant Resolution”Tenants are automatically resolved from:
- Domain:
tenant1.com→ Resolves tenant with domaintenant1.com - Subdomain:
tenant1.app.com→ Resolves tenant with subdomaintenant1 - Path:
app.com/tenant1→ Resolves tenant with slugtenant1
Typical Workflow
Section titled “Typical Workflow”- Create Tenant: Create a new tenant with domain or subdomain
- Configure Database: The database is created automatically
- Run Migrations: Migrations are executed automatically
- Create Users: Create users for the tenant with appropriate roles
- Access Panel: Access the tenant panel from its domain
Next Steps
Section titled “Next Steps”- Start by creating your first tenant in Create Tenants
- Then create users in Manage Users
- Configure your models in Working with Models