PHPackages                             webhub/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. webhub/vat

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webhub/vat
==========

kdeldycke's VAT rates wrapped in a PHP library

0.7.0(7y ago)0121MITPHPPHP ^7.1

Since Mar 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/webhub-oss/php-vat-rates)[ Packagist](https://packagist.org/packages/webhub/vat)[ RSS](/packages/webhub-vat/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (14)Used By (0)

European VAT information easily available
=========================================

[](#european-vat-information-easily-available)

[![Build Status](https://camo.githubusercontent.com/9710f4d993eb56f479c945ac191416e6812eb9122051b0ca51efb3dec4544147/68747470733a2f2f7472617669732d63692e6f72672f7765626875622d6f73732f7068702d7661742d72617465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webhub-oss/php-vat-rates)[![codecov](https://camo.githubusercontent.com/bb08fee7617e4f321ba4b60904a96ce83ad03207c0287b2ce87e3014793219fc/68747470733a2f2f636f6465636f762e696f2f67682f7765626875622d6f73732f7068702d7661742d72617465732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/webhub-oss/php-vat-rates)[![Latest Stable Version](https://camo.githubusercontent.com/9227317dcbd5a7add589e39b72d4c2f32d2820302ca1b0197beea1e85936c717/68747470733a2f2f706f7365722e707567782e6f72672f7765626875622f7661742f762f737461626c65)](https://packagist.org/packages/webhub/vat)[![Total Downloads](https://camo.githubusercontent.com/60aacc476d8127e1cd47caba008dcb3dd8668b344fdfc93343312cf4e8177b18/68747470733a2f2f706f7365722e707567782e6f72672f7765626875622f7661742f646f776e6c6f616473)](https://packagist.org/packages/webhub/vat)[![License](https://camo.githubusercontent.com/76d6e59a4d7ceb12cc7144f377613079b7b8d03b7ddb3ee9503018370f2f9115/68747470733a2f2f706f7365722e707567782e6f72672f7765626875622f7661742f6c6963656e7365)](https://packagist.org/packages/webhub/vat)

This is a wrapper of [kdeldycke/vat-rates](https://github.com/kdeldycke/vat-rates).

🛠 Usage
-------

[](#-usage)

### Installation

[](#installation)

```
composer require webhub/vat

```

### Basic use

[](#basic-use)

```
use Webhub\Vat\Rates;

$rate = (new Rates)->in('NL')->current()->get();

$rate->rate(); // 0.21
$rate->currencyCode(); // 'EUR'

$rate = (new Rates)->in('BE')->at('1990-01-01')->get();
$rate->rate(); // 0.12
```

### Rates

[](#rates)

A `Rates` instance is a collection of rates.

Rates can be filtered:

- `->in(string $territory)` a territory like `DE` or `NL`
- `->at(string|Carbon $when)` a date like `2018-01-05`, supports Carbon
- `->current()` alias for `->at(Carbon::now())`
- `->type(string $type)` rate type, currently the database only contains *standard* rates.

When one rate remains, the `->get() : Rate` method retrieves it, otherwise it throws. Obtain all rates through `->all() : array`.

### Rate

[](#rate)

A `Rate` has:

- `->rate() : string` decimal fraction representation of the rate, e.g. '0.20' for 20%
- `->rateType() : string` type of the rate, currently `standard`.
- `->(start|stop)Date() : Carbon` Carbon date instance of first valid day and subsequent first not-valid day.
- `->currencyCode() : string` currency like `SEK` or `EUR`
- `->description() : ?string` optional description of the rate

`Rates` proxies method calls to the underlying `Rate` if it exists and is unique.

```
// with ->get()
(new Rates)->in('DE')->current()->get()->rate();
// equals shorter:
(new Rates)->in('DE')->current()->rate();

// non unique
(new Rates)->in('FR')->rate();  // throws AmbiguousResultException
(new Rates)->in('XX')->get();   // throws NoResultException
```

#### Rate array access

[](#rate-array-access)

A `Rate` implements `ArrayAccess`, so when using with for example Laravel's Collection, this is perfectly possible:

```
collect((new Rates)->in('NL')->all())
  ->sortBy('start_date')
  ->pluck('rate', 'start_date');
```

📝 Compiling a new dataset
-------------------------

[](#-compiling-a-new-dataset)

Data is obtained from `kdeldycke/vat-rates` and written to a PHP file `data.php` that is included in `Rates`.

```
composer install
composer run build  // runs Generator::generate()

```

🇪🇺
==

[](#)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

13

Last Release

2606d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f72b9c1a481450b37bb3f8b1e97e64634d1b1fc2ceda19aee96cde4c40c2264?d=identicon)[tomlankhorst](/maintainers/tomlankhorst)

---

Top Contributors

[![tomlankhorst](https://avatars.githubusercontent.com/u/675432?v=4)](https://github.com/tomlankhorst "tomlankhorst (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

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