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

changePasswordWithoutCheck() public method

Change a user's password without checking their old password first
public changePasswordWithoutCheck ( $data ) : Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse
$data
return Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse
    public function changePasswordWithoutCheck($data)
    {
        try {
            $user = $this->sentry->getUserProvider()->findById($data['id']);
            // Set the new password (Sentry will hash it behind the scenes)
            $user->password = e($data['newPassword']);
            if ($user->save()) {
                // User saved
                $this->dispatcher->fire('sentinel.user.passwordchange', ['user' => $user]);
                return new SuccessResponse(trans('Sentinel::users.passwordchg'), ['user' => $user]);
            }
            // User not Saved
            return new FailureResponse(trans('Sentinel::users.passwordprob'), ['user' => $user]);
        } catch (UserNotFoundException $e) {
            $message = trans('Sentinel::sessions.invalid');
            return new ExceptionResponse($message);
        }
    }