Skip to content

Commit

Permalink
Fix array reverse issue
Browse files Browse the repository at this point in the history
  • Loading branch information
askvortsov1 committed Dec 5, 2020
1 parent 4590084 commit fb7237a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/User/Access/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function allows(User $actor, string $ability, $model): bool
$appliedPolicies = [];

if ($model) {
$modelClasses = is_string($model) ? [$model] : array_merge(array_reverse(class_parents(($model)), [get_class($model)]));
$modelClasses = is_string($model) ? [$model] : array_merge(class_parents(($model)), [get_class($model)]);

foreach ($modelClasses as $class) {
$appliedPolicies = array_merge($appliedPolicies, Arr::get($this->policies, $class, []));
Expand Down

0 comments on commit fb7237a

Please sign in to comment.