Skip to content

Commit

Permalink
Do not use Helper::hidrateModel, data from cache can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
deveres committed Dec 19, 2017
1 parent 3ce89ac commit 4c03490
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Traits/LaratrustRoleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ public function hasPermission($permission, $requireAll = false)
}

foreach ($this->cachedPermissions() as $perm) {
$perm = Helper::hidrateModel(Config::get('laratrust.models.permission'), $perm);

if (str_is($permission, $perm->name)) {
if (str_is($permission, $perm['name'])) {
return true;
}
}
Expand Down

0 comments on commit 4c03490

Please sign in to comment.