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

Update src/Database/Concerns/BelongsToTenant.php

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
lukinovec 2024-01-25 14:14:00 +01:00 committed by GitHub
parent 96615f02ea
commit 193efce9c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@ trait BelongsToTenant
public static function bootBelongsToTenant(): void
{
// 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)) {
static::addGlobalScope(new TenantScope);
}