A package for validating EU VAT numbers, checking their format and existence.
- ✔ VIES
This package can be installed via composer:
$ composer require bolivir/vat
The method validateFormat
will check the format for a given VAT number. It will not check the existence!
Example:
$VAT = new \Bolivir\Vat\Vat();
$response = $VAT->validateFormat('FR12345678901');
Calling the validateFormat
method will return a VatFormatValidationResponse
Bolivir\Vat\VatFormatValidationResponse {
-countryCode: string
-vatNumber: string
-valid: boolean
}
The method validate
will check the vat number for real existence, it will check it by the VIES service
Example:
$VAT = new \Bolivir\Vat\Vat();
echo $VAT->validate('FR12345678901');
Calling the validate
method will return a VatValidationResponse
Bolivir\Vat\VatValidationResponse {
-countryCode: string
-vatNumber: string
-requestDate: string
-valid: boolean
-name: string
-address: string
}
Please see CHANGELOG for more information on what has been changed recently.
If you discover any security related issues, please email mosselmanricardo@gmail.com instead of using the issue tracker.