diff --git a/composer.json b/composer.json index ff4820f..424dc9a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "bican/roles", + "name": "afroware/laravel-roles", "description": "Powerful package for handling roles and permissions in Laravel 5.", "keywords": ["roles", "permissions", "acl", "auth", "laravel", "illuminate"], "license": "MIT", diff --git a/src/Bican/Roles/Traits/HasRoleAndPermission.php b/src/Bican/Roles/Traits/HasRoleAndPermission.php index 840cc1c..a27ae9c 100644 --- a/src/Bican/Roles/Traits/HasRoleAndPermission.php +++ b/src/Bican/Roles/Traits/HasRoleAndPermission.php @@ -101,7 +101,7 @@ public function isAll($role) public function hasRole($role) { return $this->getRoles()->contains(function ($key, $value) use ($role) { - return $role == $value->id || Str::is($role, $value->slug); + return $role == $key->id || Str::is($role, $key->slug); }); }