Skip to content

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.

  1. Create Tenants - Learn to create and manage tenants
  2. Manage Users - Create users with roles and permissions
  3. Working with Models - Use traits and models from the package
  4. Middleware and Security - Configure and understand security middleware

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

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.

Tenants are automatically resolved from:

  • Domain: tenant1.com → Resolves tenant with domain tenant1.com
  • Subdomain: tenant1.app.com → Resolves tenant with subdomain tenant1
  • Path: app.com/tenant1 → Resolves tenant with slug tenant1
  1. Create Tenant: Create a new tenant with domain or subdomain
  2. Configure Database: The database is created automatically
  3. Run Migrations: Migrations are executed automatically
  4. Create Users: Create users for the tenant with appropriate roles
  5. Access Panel: Access the tenant panel from its domain