Skip to main content

Setting up multi-tenancy with Filament’s implementation

  1. To set up multi-tenancy with Filament Panels and Filament’s multi-tenancy implementation, first set up multi-tenancy in Filament per Filament’s instructions.
  2. After setting up tenancy in Filament, run the AddTenancy command:
    php artisan advanced-tables:add-tenancy
    
    This command will add and run the necessary migrations to finishing setting up multi-tenancy in Advanced Tables.

Setting up multi-tenancy with a third party implementation

  1. To set up multi-tenancy with Filament Panels and Spatie Multi-tenancy or Tenancy For Laravel you will need to pass your Tenant::class to the ->tenant() method of the AdvancedTablesPlugin object:
    AdvancedTablesPlugin::make()
        // Spatie
        ->tenant(\Spatie\Multitenancy\Models\Tenant::class)
        // TenancyForLaravel
        ->tenant(\Stancl\Tenancy\Database\Models\Tenant::class)
    
  2. After setting up tenancy, run the AddTenancy command:
    php artisan advanced-tables:add-tenancy
    
    This command will add and run the necessary migrations to finishing setting up multi-tenancy in Advanced Tables.

Setting up multi-tenancy in Filament’s standalone Table Builder with a third party implementation

  1. To set up multi-tenancy with Filament’s standalone Table Builder along with Spatie Multi-tenancy or Tenancy For Laravel you will need to add your Tenant::class to your advanced-tables.php config file:
    'tenancy' => [
        'tenant' => \Spatie\Multitenancy\Models\Tenant::class,
    ],
    
  2. After you have configured your tenant model, you may proceed to run the AddTenancy command:
    php artisan advanced-tables:add-tenancy
    
    This command will add and run the necessary migrations to finishing setting up multi-tenancy in Advanced Tables.