src/logic/PhoneConfirmer.php
public function requestCode()
    {
        if (!$this->notifyTries->isIntervalSatisfied()) {
            throw new PhoneConfirmationException('Minimum interval between confirmation code requests is not satisfied');
        }
        if (!$this->notifyTries->tries_left) {
            throw new PhoneConfirmationException('Tries are exceeded. Please, contact support.');
        }

        try {
            Contact::perform('notify-confirm-phone', [
                'id' => $this->model->id,
                'type' => $this->model->type,
            ]);
        } catch (ResponseErrorException $e) {
            throw new PhoneConfirmationException('Failed to request code confirmation', 0, $e);
        }

        return true;
    }
public function requestCode()
    {
        if (!$this->notifyTries->isIntervalSatisfied()) {
            throw new PhoneConfirmationException('Minimum interval between confirmation code requests is not satisfied');
        }
        if (!$this->notifyTries->tries_left) {
            throw new PhoneConfirmationException('Tries are exceeded. Please, contact support.');
        }

        try {
            Contact::perform('notify-confirm-phone', [
                'id' => $this->model->id,
                'type' => $this->model->type,
            ]);
        } catch (ResponseErrorException $e) {
            throw new PhoneConfirmationException('Failed to request code confirmation', 0, $e);
        }

        return true;
    }
public function requestCode ( ) { if ( ! $ this -> notifyTries -> isIntervalSatisfied ( ) ) { throw new PhoneConfirmationException ( 'Minimum interval between confirmation code requests is not satisfied' ) ; } if ( ! $ this -> notifyTries -> tries_left ) { throw new PhoneConfirmationException ( 'Tries are exceeded. Please, contact support.' ) ; } try { Contact :: perform ( 'notify-confirm-phone' , [ 'id' => $ this -> model -> id , 'type' => $ this -> model -> type , ] ) ; } catch ( ResponseErrorException $ e ) { throw new PhoneConfirmationException ( 'Failed to request code confirmation' , 0 , $ e ) ; } return true ; }
Requests API to send the phone number confirmation code.
@throws PhoneConfirmationException
@return bool
Requests API to send the phone number confirmation code .