original_string: public function updatePassword(UpdateProfilePasswordRequest $request)
      {
          $user = $this->user->find($this->auth->id());
  
          $credentials = [
              'id'       => $this->auth->id(),
              'email'    => $user->email,
              'password' => $request->old_password,
          ];
  
          if (! $this->auth->attempt($credentials)) {
              Flash::error(trans('user::messages.invalid old password'));
  
              return redirect()->back();
          }
  
          $this->user->update($request->all(), $this->auth->id());
  
          flash(trans('user::messages.password updated'));
  
          return redirect()->back();
      }
code: public function updatePassword(UpdateProfilePasswordRequest $request)
      {
          $user = $this->user->find($this->auth->id());
  
          $credentials = [
              'id'       => $this->auth->id(),
              'email'    => $user->email,
              'password' => $request->old_password,
          ];
  
          if (! $this->auth->attempt($credentials)) {
              Flash::error(trans('user::messages.invalid old password'));
  
              return redirect()->back();
          }
  
          $this->user->update($request->all(), $this->auth->id());
  
          flash(trans('user::messages.password updated'));
  
          return redirect()->back();
      }
code_tokens: public function updatePassword ( UpdateProfilePasswordRequest $ request ) { $ user = $ this -> user -> find ( $ this -> auth -> id ( ) ) ; $ credentials = [ 'id' => $ this -> auth -> id ( ) , 'email' => $ user -> email , 'password' => $ request -> old_password , ] ; if ( ! $ this -> auth -> attempt ( $ credentials ) ) { Flash :: error ( trans ( 'user::messages.invalid old password' ) ) ; return redirect ( ) -> back ( ) ; } $ this -> user -> update ( $ request -> all ( ) , $ this -> auth -> id ( ) ) ; flash ( trans ( 'user::messages.password updated' ) ) ; return redirect ( ) -> back ( ) ; }
docstring: Update the password of the given user.
  
  @param UpdateProfilePasswordRequest|UpdateUserRequest $request
  
  @return Response
  
  @internal param int $id
docstring_tokens: Update the password of the given user .