', $blocked_role_id) ->pluck('id') ->toArray(); if (in_array($manager_role_id, $role_ids)) { // Allows manager access to the role list, user list. $new_manager_rules = [ ['roles', 'list'], ['users', 'manager_access'], ]; foreach ($new_manager_rules as $rule) { [$object, $action] = $rule; Rule::withTrashed()->updateOrCreate([ 'role_id' => $manager_role_id, 'object' => $object, 'action' => $action, ], [ 'allow' => true, 'deleted_at' => null, ]); } } } /** * Reverse the migrations. * * @return void */ public function down() { } }