Skip to content

Commit

Permalink
Fix For Laravel Authorization
Browse files Browse the repository at this point in the history
fix for using auth()->user()->can('permission-slug')
  • Loading branch information
MirHamit authored Mar 29, 2022
1 parent 56e7ad7 commit c6167e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ACLServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c6167e2

Please sign in to comment.