- no more before
Gate::before(function (User $user) {
if ($user->isAdmin()) {
return true;
}
});
- simplify code in policies
public function view(User $auth, User $user): bool
{
return $auth->isStaff() || $user->is($auth);
}
"repositories": {
"studios-neptune/permissions": {
"type": "vcs",
"url": "[email protected]:studios-neptune/permissions.git"
},
},
composer require studios-neptune/permissions
composer install
composer install --working-dir tools/php-cs-fixer
- user->permissions as intersection of all user role permissions and from user permissions
- user->hasPermission(string $permission)
- user->hasAllPermissions(array $permissions)
- user->hasAnyPermissions(array $permissions)