/vat-php

European VAT rates and number validation.

Primary LanguagePHPMIT LicenseMIT




This project is under construction
We are hard at work to create this awesome package. Please check in with us later to see the released product.

European VAT utility for PHP

codecov GitHub Workflow Status Packagist PHP Version Support Packagist PHP Version Support Packagist Downloads

Usage

$vatServcie = new \SandwaveIo\Vat\Vat;

$vatServcie->validateVatNumber("YOURVATNUMBERHERE"); // true

$vatServcie->countryInEurope('NL'); // true

$vatServcie->europeanVatRate("YOURVATNUMBERHERE", "NL"); // 0.0

External documentation

How to contribute

Feel free to create a PR if you have any ideas for improvements. Or create an issue.

  • When adding code, make sure to add tests for it (phpunit).
  • Make sure the code adheres to our coding standards (use php-cs-fixer to check/fix).
  • Also make sure PHPStan does not find any bugs.
vendor/bin/php-cs-fixer fix

vendor/bin/phpstan analyze

vendor/bin/phpunit --coverage-text

These tools will also run in GitHub actions on PR's and pushes on master.