Ejemplo n.º 1
0
 /**
  * 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'));
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * @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'));
 }