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

Use new static instead of checking class_implements()

This commit is contained in:
lukinovec 2023-06-14 08:27:40 +02:00
parent f0faf41522
commit 73144a874a

View file

@ -23,7 +23,7 @@ trait BelongsToTenant
{
// If tenancy.database.rls is true or this model implements RlsModel
// Scope queries using Postgres RLS instead of TenantScope
if (! (config('tenancy.database.rls') || in_array(RlsModel::class, class_implements(static::class)))) {
if (! (config('tenancy.database.rls') || (new static) instanceof RLSModel)) {
static::addGlobalScope(new TenantScope);
}