© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Abi

Multi Tenancy associate Tenant to Resource

I have created a model that has a
team_id
team_id
column and also a
team()
team()
relation to the
Team
Team
model. The
Team
Team
model has been setup as the
tenant
tenant
model on the Provider.
//AdminPanelProvider.php
$panel->tenant(model: Team::class, slugAttribute: 'slug', ownershipRelationship: 'team')
//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
SQLSTATE[HY000]: General error: 1364 Field 'team_id' doesn't have a default value

Any advice?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Multi-Tenancy HasManyThrough Tenant Relationship
FilamentFFilament / ❓┊help
3y ago
Tenancy: associate created record with tenant in CreateAction
FilamentFFilament / ❓┊help
3y ago
Multi Tenancy within multi tenancy
FilamentFFilament / ❓┊help
2y ago
Multi-Tenancy: remove the tenant URL slug?
FilamentFFilament / ❓┊help
4mo ago