From c6167e2cdbcd2ad7f833c7a01b8ef5acdcd673ed Mon Sep 17 00:00:00 2001 From: Hamid Musavi Date: Tue, 29 Mar 2022 10:50:42 +0430 Subject: [PATCH] Fix For Laravel Authorization fix for using auth()->user()->can('permission-slug') --- src/ACLServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACLServiceProvider.php b/src/ACLServiceProvider.php index 7fd4b3d..e7336b4 100644 --- a/src/ACLServiceProvider.php +++ b/src/ACLServiceProvider.php @@ -57,7 +57,7 @@ protected function registerGate() try { Permission::get()->map(function ($permission) { Gate::define($permission->slug, function ($user) use ($permission) { - return $user->hasPermissionTo($permission); + return $user->hasPermissionTo($permission->slug); }); }); } catch (Exception $e) {