src/Models/User.php
public function routeNotificationForAuthy(): ?int
    {
        if (! ($authyId = array_get($this->getTwoFactor(), 'phone.authy_id')) && $this->getEmailForVerification() && $this->getPhoneForVerification() && $this->getCountryForVerification()) {
            $result = app('rinvex.authy.user')->register($this->getEmailForVerification(), preg_replace('/[^0-9]/', '', $this->getPhoneForVerification()), $this->getCountryForVerification());
            $authyId = $result->get('user')['id'];

            // Prepare required variables
            $twoFactor = $this->getTwoFactor();

            // Update user account
            array_set($twoFactor, 'phone.authy_id', $authyId);

            $this->fill(['two_factor' => $twoFactor])->forceSave();
        }

        return $authyId;
    }
public function routeNotificationForAuthy(): ?int
    {
        if (! ($authyId = array_get($this->getTwoFactor(), 'phone.authy_id')) && $this->getEmailForVerification() && $this->getPhoneForVerification() && $this->getCountryForVerification()) {
            $result = app('rinvex.authy.user')->register($this->getEmailForVerification(), preg_replace('/[^0-9]/', '', $this->getPhoneForVerification()), $this->getCountryForVerification());
            $authyId = $result->get('user')['id'];

            // Prepare required variables
            $twoFactor = $this->getTwoFactor();

            // Update user account
            array_set($twoFactor, 'phone.authy_id', $authyId);

            $this->fill(['two_factor' => $twoFactor])->forceSave();
        }

        return $authyId;
    }
public function routeNotificationForAuthy ( ) : ? int { if ( ! ( $ authyId = array_get ( $ this -> getTwoFactor ( ) , 'phone.authy_id' ) ) && $ this -> getEmailForVerification ( ) && $ this -> getPhoneForVerification ( ) && $ this -> getCountryForVerification ( ) ) { $ result = app ( 'rinvex.authy.user' ) -> register ( $ this -> getEmailForVerification ( ) , preg_replace ( '/[^0-9]/' , '' , $ this -> getPhoneForVerification ( ) ) , $ this -> getCountryForVerification ( ) ) ; $ authyId = $ result -> get ( 'user' ) [ 'id' ] ; // Prepare required variables $ twoFactor = $ this -> getTwoFactor ( ) ; // Update user account array_set ( $ twoFactor , 'phone.authy_id' , $ authyId ) ; $ this -> fill ( [ 'two_factor' => $ twoFactor ] ) -> forceSave ( ) ; } return $ authyId ; }
Route notifications for the authy channel.

@return int|null
Route notifications for the authy channel .