© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
Jon Mason

Multi-tenancy with Shield

Does my roles table have to have a team_id?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles.team_id' in 'where clause'
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles.team_id' in 'where clause'


I would think roles would be the same regardless of the team, so I think I probably have something configured incorrectly.

If I take the team relationship off my role model I get:

The model [App\Models\Role] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [BezhanSalleh\FilamentShield\Resources\RoleResource] resource class.
The model [App\Models\Role] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [BezhanSalleh\FilamentShield\Resources\RoleResource] resource class.

So it seems that every single table has to have a
team_id
team_id
for multi-tenancy?
Solution
protected static bool $isScopedToTenant = false;
Jump to solution
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

shield and multi tenancy
FilamentFFilament / ❓┊help
3y ago
❓ Issue in Filament Shield with multi-tenancy
FilamentFFilament / ❓┊help
10mo ago
Multi Tenancy within multi tenancy
FilamentFFilament / ❓┊help
2y ago
Muti-tenancy shield
FilamentFFilament / ❓┊help
8mo ago