Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
henryavila authored and github-actions[bot] committed Sep 1, 2023
1 parent 524eace commit 24c5bed
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ public function belongsToCurrentTenant(): bool
return $this->belongsToTenantId(Tenant::current()->id);
}

public function userAndModelBelongsToActiveTenant(Model $model): bool
{
$belongsToCurrentTenant = $this->belongsToCurrentTenant();
public function userAndModelBelongsToActiveTenant(Model $model): bool
{
$belongsToCurrentTenant = $this->belongsToCurrentTenant();

if (method_exists($model, 'tenants')) {
return $belongsToCurrentTenant && $model->tenants()->pluck('id')->contains(Tenant::current()->id);
}
if (method_exists($model, 'tenant')) {
return $belongsToCurrentTenant && $model->tenant?->id === Tenant::current()->id;
}
if (method_exists($model, 'tenants')) {
return $belongsToCurrentTenant && $model->tenants()->pluck('id')->contains(Tenant::current()->id);
}
if (method_exists($model, 'tenant')) {
return $belongsToCurrentTenant && $model->tenant?->id === Tenant::current()->id;
}

return $belongsToCurrentTenant;
}
return $belongsToCurrentTenant;
}
}

0 comments on commit 24c5bed

Please sign in to comment.