Example #1
0
 /**
  * Show the form for editing the role users.
  *
  * @param  int  $id
  * @return Response
  */
 public function editRoleUsers($id)
 {
     if (Shinobi::can(config('watchtower.acl.role.users', false))) {
         $role = Role::findOrFail($id);
         $users = $role->users;
         $available_users = User::whereDoesntHave('roles', function ($query) use($id) {
             $query->where('role_id', $id);
         })->get();
         return view(config('watchtower.views.roles.user'), compact('role', 'users', 'available_users'));
     }
     return view(config('watchtower.views.layouts.unauthorized'), ['message' => 'sync role users']);
 }