Skip to content

Commit

Permalink
Update 11-tenancy.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Mar 19, 2024
1 parent 6f2fa02 commit 067a8ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/panels/docs/11-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ To set up a registration page, you'll need to create a new page class that exten
```php
namespace App\Filament\Pages\Tenancy;

use App\Models\Team;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\RegisterTenant;
Expand Down Expand Up @@ -499,6 +500,7 @@ When creating and listing records associated with a Tenant, Filament needs acces
You can customize the name of the ownership relationship used across all resources at once, using the `ownershipRelationship` argument on the `tenant()` configuration method. In this example, resource model classes have an `owner` relationship defined:

```php
use App\Models\Team;
use Filament\Panel;

public function panel(Panel $panel): Panel
Expand Down Expand Up @@ -542,6 +544,7 @@ class PostResource extends Resource
When using a tenant like a team, you might want to add a slug field to the URL rather than the team's ID. You can do that with the `slugAttribute` argument on the `tenant()` configuration method:

```php
use App\Models\Team;
use Filament\Panel;

public function panel(Panel $panel): Panel
Expand Down Expand Up @@ -673,6 +676,7 @@ public function panel(Panel $panel): Panel
By default the URL structure will put the tenant ID or slug immediately after the panel path. If you wish to prefix it with another URL segment, use the `tenantRoutePrefix()` method:

```php
use App\Models\Team;
use Filament\Panel;

public function panel(Panel $panel): Panel
Expand All @@ -692,6 +696,7 @@ Before, the URL structure was `/admin/1` for tenant 1. Now, it is `/admin/team/1
When using a tenant, you might want to use domain or subdomain routing like `team1.example.com/posts` instead of a route prefix like `/team1/posts` . You can do that with the `tenantDomain()` method, alongside the `tenant()` configuration method. The `tenant` argument name is followed by a colon `:` and then the attribute you wish to resolve that part of the domain using, like the `slug` attribute:

```php
use App\Models\Team;
use Filament\Panel;

public function panel(Panel $panel): Panel
Expand All @@ -706,6 +711,7 @@ public function panel(Panel $panel): Panel
In the above examples, the tenants live on subdomains of the main app domain. You may also set the system up to resolve the entire domain from the tenant as well:

```php
use App\Models\Team;
use Filament\Panel;

public function panel(Panel $panel): Panel
Expand Down

0 comments on commit 067a8ca

Please sign in to comment.