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

Add config('tenancy.database.rls')

This commit is contained in:
lukinovec 2023-06-05 16:33:26 +02:00
parent cb775a9fba
commit bad5c693ab
2 changed files with 9 additions and 6 deletions

View file

@ -21,8 +21,8 @@ trait BelongsToTenant
public static function bootBelongsToTenant(): void
{
// Queries of models present in the tenancy.models.rls config are scoped using Postgres RLS instead of the global scope
if (! in_array(static::class, config('tenancy.models.rls'))) {
// If tenancy.database.rls is true, scope queries using Postgres RLS instead of TenantScope
if (! config('tenancy.database.rls')) {
static::addGlobalScope(new TenantScope);
}