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:
parent
741af3929c
commit
00af2d6eaf
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue