Skip to content

Commit

Permalink
refactor helper functions to Str class.
Browse files Browse the repository at this point in the history
  • Loading branch information
secmohammed authored Apr 10, 2020
1 parent 39027b7 commit 4cdd758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/Roles/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Artify\Artify\Traits\Roles;

use Illuminate\Support\Collection;
use Illuminate\Support\{Collection, Str};

trait Roles
{
Expand Down Expand Up @@ -31,7 +31,7 @@ public function hasAnyRole(array $roles): bool
public function hasRole(string $role): bool
{
return $this->getPermissions()->contains(function ($value, $key) use ($role) {
return ($key === $role || (str_is($role, $key) || str_is($key, $role))) && $value;
return ($key === $role || (Str::is($role, $key) || Str::is($key, $role))) && $value;
});
}

Expand Down

0 comments on commit 4cdd758

Please sign in to comment.