1. Go to this page and download the library: Download ibericode/vat-bundle 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/ */
use Ibericode\Vat\Countries;
use Ibericode\Vat\Validator;
use Ibericode\Vat\Rates;
use Ibericode\Vat\Geolocator;
class MyController
{
/**
* Type-hint the class on your service constructors to retrieve a class instance
*/
public function __construct(
Rates $rates,
Validator $validator,
Countries $countries,
Geolocator $geolocator
)
{
$rates->getRateForCountry('NL'); // 21.00
$validator->validateVatNumber('NL123456789B01'); // false
$countries->isCountryCodeInEU('US') // false
$geolocator->locateIpAddress('8.8.8.8'); // US
}
}
use Ibericode\Vat\Bundle\Validator\Constraints\VatNumber;
class Customer
{
/**
* @VatNumber()
*/
public $vatNumber;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.