FilamentF
Filament2y ago
Abi

Multi Tenancy associate Tenant to Resource

I have created a model that has a team_id column and also a team() relation to the Team model. The Team model has been setup as the tenant model on the Provider.
//AdminPanelProvider.php
$panel->tenant(model: Team::class, slugAttribute: 'slug', ownershipRelationship: 'team')

Do I need to do anything else in each resource to associate the tenant id for the CRUD operations?

I get this error when I create a new record on a resource inside the Multi Tenancy Panel
SQLSTATE[HY000]: General error: 1364 Field 'team_id' doesn't have a default value

Any advice?
Was this page helpful?