/**
  * Update user
  *
  * @return Response
  */
 public function postUpdate(\App\Http\Requests\UpdateRequest $request)
 {
     $user = $this->auth->user();
     $credentials = ['username' => $user->username, 'password' => $request['old_password']];
     if ($this->auth->validate($credentials)) {
         $this->user->update($user->id, $request->only('email', 'password'));
         return redirect()->action('AuthenticationController@getUpdate')->with('flash_message', trans('authentication.update_success'));
     }
     return redirect()->action('AuthenticationController@getUpdate')->withInput($request->only('email'))->with('flash_message', trans('authentication.not_matched'));
 }
Ejemplo n.º 2
0
 /**
  * Update the specified update in storage.
  *
  * @param  int           $id
  * @param  UpdateRequest $request
  * @return Response
  */
 public function update($id, UpdateRequest $request)
 {
     $update = $this->update->find($id);
     if (!$update) {
         return redirect()->back()->with('error', 'Country Update not found.');
     }
     if (!$update->update($request->all())) {
         return redirect()->back()->with('error', 'Problem editing Country Update.');
     }
     return redirect()->back()->with('success', 'Country Update successfully updated!');
 }