1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 19:24:02 +00:00

Check for class traits instead of the DB columns

This commit is contained in:
lukinovec 2023-06-15 09:32:25 +02:00
parent 741af3929c
commit 00af2d6eaf

View file

@ -65,7 +65,7 @@ trait DealsWithModels
public static function modelBelongsToTenant(Model $model): bool
{
return Schema::hasColumn($model->getTable(), static::tenantKeyColumn());
return in_array(BelongsToTenant::class, class_uses_recursive($model::class));
}
public static function modelBelongsToTenantIndirectly(Model $model): bool