/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, UpdateUser $request) { $user = $this->user->update($request->all()); $request->ajax(); return redirect('admin/user/' . $user->id)->with(array('status' => 'success', 'message' => 'Utilisateur mis à jour')); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, UpdateUser $request) { $user = $this->user->update($request->all()); $request->ajax(); return redirect('user/' . $user->id); }
/** * @param $id * @param UpdateUserRequest $request */ public function update(UpdateUser $request, $id) { $this->authorize('authorizeOwnership', $id); $user = $this->userRepository->model->find($id); $user->update($request->all()); $user->save(); $this->authorize('authorizeOwnership', $id); $user->fill($request->all()); if ($request->hasFile('avatar')) { /* * Abstract CreateImages Job (Model , $request, FolderName, FieldsName , Default thumbnail sizes , Default large sizes * */ $this->dispatch(new CreateImages($user, $request, 'avatar', ['avatar'])); } if ($request->get('role')) { $user->roles()->sync($request->get('role')); $user->level = $request->get('role')[0]; $user->save(); } if ($this->isAuthor()) { Session::forget('module'); return redirect()->action('Backend\\DashboardController@index')->with('success', trans('messages.success.updated')); } return redirect()->action('Backend\\UsersController@index')->with('success', trans('messages.success.updated')); }