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();
    }
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();
    }
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 ( ) ; }
Update the password of the given user.

@param UpdateProfilePasswordRequest|UpdateUserRequest $request

@return Response

@internal param int $id
Update the password of the given user .