Skip to content

Commit

Permalink
feat: Policies: divide a logic
Browse files Browse the repository at this point in the history
  • Loading branch information
efureev committed Mar 9, 2022
1 parent 9aa6276 commit 423bffe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ServiceProviders/HasPolicies.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ protected function registerPolicies(): static
protected function registerPoliciesForce(array $policies): static
{
foreach ($policies as $modelForPolicy => $policy) {
Gate::policy($modelForPolicy, $policy);
static::registerPolicy($modelForPolicy, $policy);
}

return $this;
}

protected static function registerPolicy(string $model, string $policy): void
{
Gate::policy($model, $policy);
}
}

0 comments on commit 423bffe

Please sign in to comment.