Simply require the package via composer:
composer require drahosistvan/vatvalidation
$validation = new VatValidation();
$validation->validate('UK123321213');
if ($validation->valid) {
print $validation->name;
print $validation->address;
print $validation->countryCode;
print $validation->vatNumber;
print $validation->valid;
}
It has a toArray
method, so you can cast the validation data to an array.
$validation = new VatValidation();
$validation->validate('UK123321213');
var_dump($validation->toArray());