PHPackages                             sandwave-io/vat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sandwave-io/vat

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

sandwave-io/vat
===============

European VAT rates and number validation.

1.1.0(3y ago)113.5k4MITPHPPHP ^8.1

Since Feb 5Pushed 1y ago7 watchersCompare

[ Source](https://github.com/sandwave-io/vat-php)[ Packagist](https://packagist.org/packages/sandwave-io/vat)[ RSS](/packages/sandwave-io-vat/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (10)Versions (6)Used By (0)

[![](https://user-images.githubusercontent.com/60096509/91668964-54ecd500-eb11-11ea-9c35-e8f0b20b277a.png)](https://sandwave.io)

European VAT utility for PHP
============================

[](#european-vat-utility-for-php)

[![codecov](https://camo.githubusercontent.com/e5b2c8c60dc4118b72fbab4fe0529318dc787a681a93eb4941370f5f5b8c4c32/68747470733a2f2f636f6465636f762e696f2f67682f73616e64776176652d696f2f7661742d7068702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d5a394f4f464132343749)](https://codecov.io/gh/sandwave-io/vat-php)[![GitHub Workflow Status](https://camo.githubusercontent.com/7de04bbba95514bb97ff5254d6fae6f3668166bc3bd3ea48d6cf9890e400259a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616e64776176652d696f2f7661742d7068702f63692e796d6c3f6272616e63683d6d61696e)](https://packagist.org/packages/sandwave-io/vat)[![Packagist PHP Version Support](https://camo.githubusercontent.com/caf45e2bcc05454c9abd189acc9036905646109b7f276a5922006cb5e51481ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73616e64776176652d696f2f766174)](https://packagist.org/packages/sandwave-io/vat)[![Packagist PHP Version Support](https://camo.githubusercontent.com/9d41d0483d1e613e03b099fed7524bf3f8474e9227ffdb2cd02834deb3b87de4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e64776176652d696f2f766174)](https://packagist.org/packages/sandwave-io/vat)[![Packagist Downloads](https://camo.githubusercontent.com/043ac9272a1a08278667a403850f75f5d2fcb847553202ae590d587cf79ab837/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616e64776176652d696f2f766174)](https://packagist.org/packages/sandwave-io/vat)

Usage
-----

[](#usage)

```
composer require sandwave-io/vat
```

```
$vatService = new \SandwaveIo\Vat\Vat;

$vatService->validateEuropeanVatNumber("YOURVATNUMBERHERE", "COUNTRYCODE"); // true

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

$vatService->europeanVatRate("YOURVATNUMBERHERE"); // 0.0
```

### Caching

[](#caching)

If you resolve VAT rates for a country quite often, it can be a little slow. If you want to, you can cache the results by passing a `Psr\SimpleCache\CacheInterface` to the `Vat()` service. The implementation might differ based on your application, but all major frameworks implement this interface on their cache.

```
/** @var Psr\SimpleCache\CacheInterface $cache */

$vatService = new \SandwaveIo\Vat\Vat(cache: $cache);
```

External documentation
----------------------

[](#external-documentation)

- [VIES API](https://ec.europa.eu/taxation_customs/vies/technicalInformation.html)
- [TEDB- "Taxes in Europe" database](https://ec.europa.eu/taxation_customs/economic-analysis-taxation/taxes-europe-database-tedb_en)

How to contribute
-----------------

[](#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.

### About the testsuite

[](#about-the-testsuite)

There is also an integration test, in order to skip this (heavy) test, run:

```
vendor/bin/phpunit --exclude=large
```

We generate coverage in PHPUnit. On the CI we use XDebug to do that. If you have XDebug installed, you can run:

```
vendor/bin/phpunit --coverage-text

# or generate an interactive report.
vendor/bin/phpunit --coverage-html=coverage_report
```

Alternatively, you can use *PHPDBG* as coverage driver:

```
phpdbg -qrr vendor/bin/phpunit --coverage-text
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 74.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~191 days

Total

5

Last Release

1162d ago

Major Versions

0.1.0 → 1.0.02021-02-12

PHP version history (3 changes)0.1.0PHP &gt;=7.4

1.0.1PHP &gt;=7.4|&gt;=8.0

1.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16303480?v=4)[Jesse Kramer](/maintainers/FrontEndCoffee)[@FrontEndCoffee](https://github.com/FrontEndCoffee)

![](https://avatars.githubusercontent.com/u/13864206?v=4)[sandwave](/maintainers/sandwave)[@sandwave](https://github.com/sandwave)

---

Top Contributors

[![FrontEndCoffee](https://avatars.githubusercontent.com/u/16303480?v=4)](https://github.com/FrontEndCoffee "FrontEndCoffee (70 commits)")[![patka-123](https://avatars.githubusercontent.com/u/69802930?v=4)](https://github.com/patka-123 "patka-123 (6 commits)")[![arnowest](https://avatars.githubusercontent.com/u/827502?v=4)](https://github.com/arnowest "arnowest (5 commits)")[![A1rPun](https://avatars.githubusercontent.com/u/3754692?v=4)](https://github.com/A1rPun "A1rPun (4 commits)")[![arnobot](https://avatars.githubusercontent.com/u/11441027?v=4)](https://github.com/arnobot "arnobot (4 commits)")[![paulsandwavebot](https://avatars.githubusercontent.com/u/181111594?v=4)](https://github.com/paulsandwavebot "paulsandwavebot (3 commits)")[![radriaanse](https://avatars.githubusercontent.com/u/5745445?v=4)](https://github.com/radriaanse "radriaanse (1 commits)")[![thijswiersema](https://avatars.githubusercontent.com/u/20823129?v=4)](https://github.com/thijswiersema "thijswiersema (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sandwave-io-vat/health.svg)

```
[![Health](https://phpackages.com/badges/sandwave-io-vat/health.svg)](https://phpackages.com/packages/sandwave-io-vat)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
