From 9333112a2752cbbd54b603f33bb24c43254b62fd Mon Sep 17 00:00:00 2001 From: Adel Lamallam Date: Fri, 22 Sep 2017 19:50:07 +0100 Subject: [PATCH 1/2] Update HasRoleAndPermission.php hasRole and permission works with $key not $value --- src/Bican/Roles/Traits/HasRoleAndPermission.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }); } From d118e62dba06ca2479d9c5223928e5329f9051d0 Mon Sep 17 00:00:00 2001 From: Adel Lamallam Date: Fri, 22 Sep 2017 20:00:14 +0100 Subject: [PATCH 2/2] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",