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'

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.

So it seems that every single table has to have a
team_id
for multi-tenancy?
Solution
protected static bool $isScopedToTenant = false;
Was this page helpful?