src/Traits/TwoFactorAuthenticatesUsers.php
protected function isValidTwoFactorBackup(AuthenticatableTwoFactorContract $user, int $token): bool
    {
        $backup = array_get($user->getTwoFactor(), 'totp.backup', []);
        $result = mb_strlen($token) === 10 && in_array($token, $backup);
        ! $result || $this->invalidateTwoFactorBackup($user, $token);

        return $result;
    }
protected function isValidTwoFactorBackup(AuthenticatableTwoFactorContract $user, int $token): bool
    {
        $backup = array_get($user->getTwoFactor(), 'totp.backup', []);
        $result = mb_strlen($token) === 10 && in_array($token, $backup);
        ! $result || $this->invalidateTwoFactorBackup($user, $token);

        return $result;
    }
protected function isValidTwoFactorBackup ( AuthenticatableTwoFactorContract $ user , int $ token ) : bool { $ backup = array_get ( $ user -> getTwoFactor ( ) , 'totp.backup' , [ ] ) ; $ result = mb_strlen ( $ token ) === 10 && in_array ( $ token , $ backup ) ; ! $ result || $ this -> invalidateTwoFactorBackup ( $ user , $ token ) ; return $ result ; }
Determine if the given token is a valid TwoFactor Backup code.

@param \Rinvex\Auth\Contracts\AuthenticatableTwoFactorContract $user
@param int                                                     $token

@return bool
Determine if the given token is a valid TwoFactor Backup code .