Sentinel\Repositories\User\SentryUserRepository::resetPassword PHP Method

resetPassword() public method

Process the password reset request
public resetPassword ( integer $id, string $code, $password ) : Array
$id integer
$code string
return Array
    public function resetPassword($id, $code, $password)
    {
        try {
            // Grab the user
            $user = $this->sentry->getUserProvider()->findById($id);
            // Attempt to reset the user password
            if ($user->attemptResetPassword($code, $password)) {
                // Fire the 'password reset' event
                $this->dispatcher->fire('sentinel.password.reset', ['user' => $user]);
                return new SuccessResponse(trans('Sentinel::users.passwordchg'), ['user' => $user]);
            }
            return new FailureResponse(trans('Sentinel::users.problem'), ['user' => $user]);
        } catch (UserNotFoundException $e) {
            $message = trans('Sentinel::sessions.invalid');
            return new ExceptionResponse($message);
        }
    }