From 8c87dde85d533f9cdbc4a2b54e74b10d1f7a9a51 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 15 Jun 2023 13:44:31 +0200 Subject: [PATCH] Use `getTenantModels` instead of `getModels` in RLS poilcy creation command --- src/Commands/CreateRLSPoliciesForTenantTables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/CreateRLSPoliciesForTenantTables.php b/src/Commands/CreateRLSPoliciesForTenantTables.php index 912a216e..05aeb132 100644 --- a/src/Commands/CreateRLSPoliciesForTenantTables.php +++ b/src/Commands/CreateRLSPoliciesForTenantTables.php @@ -20,7 +20,7 @@ class CreateRLSPoliciesForTenantTables extends Command public function handle(): int { DB::transaction(function () { - tenancy()->getModels()->each(fn (Model $model) => $this->useRlsOnModel($model)); + tenancy()->getTenantModels()->each(fn (Model $model) => $this->useRlsOnModel($model)); }); return Command::SUCCESS;