mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 14:14:03 +00:00
Update src/Database/Concerns/BelongsToTenant.php
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
parent
96615f02ea
commit
193efce9c0
1 changed files with 1 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ trait BelongsToTenant
|
||||||
public static function bootBelongsToTenant(): void
|
public static function bootBelongsToTenant(): void
|
||||||
{
|
{
|
||||||
// If 'tenancy.rls.enabled' is true or this model implements RLSModel
|
// If 'tenancy.rls.enabled' is true or this model implements RLSModel
|
||||||
// Scope queries using Postgres RLS instead of TenantScope
|
// Postgres RLS is used for scoping, so we don't enable the scope used with single-database tenancy.
|
||||||
if (! (config('tenancy.rls.enabled') || (new static) instanceof RLSModel)) {
|
if (! (config('tenancy.rls.enabled') || (new static) instanceof RLSModel)) {
|
||||||
static::addGlobalScope(new TenantScope);
|
static::addGlobalScope(new TenantScope);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue