/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $notification = Notification::find($id); $users = User::all(); $roles = Rol::all(); return view('notifications::update', compact('notification', 'users', 'roles')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { if (Sentinel::hasAccess('task.update')) { $task = $this->model->find($id); $users = User::all(); $roles = Rol::all(); return view('tasks::update', compact('task', 'users', 'roles')); } alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request, RolesCreateRquest $rolesCreateRquest) { $role = Rol::create($request->all()); flash()->success('El rol ha sido aƱadido.'); return redirect()->to('roles'); }
/** * Search users in that role * @param $role_id * @return mixed */ private function roles($id) { $role = Rol::find($id); return $role->users; }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // if (Sentinel::hasAccess('user.update')) { // Execute this code if the user has permission $users = Sentinel::findById($id); $rolUser = $users->roles()->get(); $roles = Rol::all()->lists('name', 'slug'); $plazas = Place::all(); $user = User::find($id); $place_user = $user->plazas()->get(); $plazas = $plazas->diff($place_user); $plazas_select = Place::plazasArray(null); return view('user::edit', compact('users', 'roles', 'rolUser', 'plazas', 'place_user', 'plazas_select')); } alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); }