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

Use reflection instead of try/catch, use arrays instead of collections

This commit is contained in:
lukinovec 2023-06-19 13:53:27 +02:00
parent 8d13ce7e2f
commit eddb95c014
3 changed files with 23 additions and 21 deletions

View file

@ -23,7 +23,9 @@ class CreateRLSPoliciesForTenantTables extends Command
public function handle(): int
{
DB::transaction(function () {
tenancy()->getTenantModels()->each(fn (Model $model) => $this->useRlsOnModel($model));
foreach (tenancy()->getTenantModels() as $model) {
$this->useRlsOnModel($model);
}
});
return Command::SUCCESS;