PHP code example of itemvirtual / vat-validate

1. Go to this page and download the library: Download itemvirtual/vat-validate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itemvirtual / vat-validate example snippets


use Itemvirtual\VatValidate\Facades\VatValidate;

VatValidate::checkSpanishVat($vat);

VatValidate::checkNif($vat);
VatValidate::checkNie($vat);
VatValidate::checkSpecialNie($vat);
VatValidate::checkCif($vat);

VatValidate::checkEuropeanVat($vat, $countryCode);

VatValidate::checkVies($vat, $countryCode);

VatValidate::getFullFormatedVat($vat, $countryCode);

$exampleVats = [
    'AT' => 'ATU12345678',
    'BE' => 'BE0123456789',
    'BG' => 'BG123456789',
    'CY' => 'CY12345678A',
    'CZ' => 'CZ12345678',
    'DE' => 'DE123456789',
    'DK' => 'DK12345678',
    'EE' => 'EE101234567',
    'GR' => 'EL123456789',
    'ES' => 'ESX1234567L',
    'FI' => 'FI12345678',
    'FR' => 'FRAB123456789',
    'GB' => 'GB123456789',
    'HR' => 'HR12345678901',
    'HU' => 'HU12345678',
    'IE' => 'IE1A23456B',
    'IT' => 'IT12345678901',
    'LV' => 'LV12345678901',
    'LT' => 'LT123456789',
    'LU' => 'LU12345678',
    'MT' => 'MT12345678',
    'NL' => 'NL123456789B01',
    'PL' => 'PL1234567890',
    'PT' => 'PT123456789',
    'RO' => 'RO123456789',
    'SE' => 'SE123456789001',
    'SI' => 'SI12345678',
    'SK' => 'SK1234567890',
];