PHPackages                             dannyvankooten/laravel-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. dannyvankooten/laravel-vat

Abandoned → [ibericode/vat](/?search=ibericode%2Fvat)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

dannyvankooten/laravel-vat
==========================

VAT library for Laravel

2.0.7(4y ago)118494.4k↓25%40[3 issues](https://github.com/dannyvankooten/laravel-vat/issues)[3 PRs](https://github.com/dannyvankooten/laravel-vat/pulls)2MITPHPPHP &gt;=7.1

Since Nov 2Pushed 3y ago6 watchersCompare

[ Source](https://github.com/dannyvankooten/laravel-vat)[ Packagist](https://packagist.org/packages/dannyvankooten/laravel-vat)[ RSS](/packages/dannyvankooten-laravel-vat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (13)Used By (2)

> **HEADS UP** I suggest using [ibericode/vat](https://github.com/ibericode/vat) directly until #22 is tackled. Working with Laravel is not on my priority list so it would require someone else to send in a PR.

Laravel VAT
===========

[](#laravel-vat)

[![Build Status](https://camo.githubusercontent.com/d8eff56aa9b41e11f73aff503f58820c13145c046f89665efd7975c28afc47ef/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64616e6e7976616e6b6f6f74656e2f6c61726176656c2d7661742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dannyvankooten/laravel-vat)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

> See [ibericode/vat-bundle](https://github.com/ibericode/vat-bundle) for a Symfony version of this package.

laravel-vat is a package that contains the Laravel related wiring code for [ibericode/vat](https://github.com/ibericode/vat/tree/1.2.1), helping you deal with VAT legislation for businesses based in the EU.

- Fetch (historical) VAT rates for any EU member state using [ibericode/vat-rates](https://github.com/ibericode/vat-rates).
- Validate VAT numbers (by format, [existence](http://ec.europa.eu/taxation_customs/vies/) or both)
- Validate ISO-3316 alpha-2 country codes
- Determine whether a country is part of the EU
- Geolocate IP addresses

Installation
------------

[](#installation)

You can install this package via [Composer](https://getcomposer.org/):

```
composer require dannyvankooten/laravel-vat
```

The package will automatically register itself.

Usage
-----

[](#usage)

Check out the [ibericode/vat README](https://github.com/ibericode/vat/tree/1.2.1) for general usage of this package.

#### Facades

[](#facades)

You can use facades to retrieve an instance of the classes provided by ibericode/vat.

```
use DvK\Laravel\Vat\Facades\Rates;
use DvK\Laravel\Vat\Facades\Validator;
use DvK\Laravel\Vat\Facades\Countries;

// Get current standard VAT rate for a country
Rates::country('NL'); // 21.00

// Get reduced VAT rate
Rates::country('NL', 'reduced'); // 6.00

// Get reduced VAT rate on a given Date
Rates::country('NL', 'reduced', new \DateTime('2005-01-01')); // 19.00

// Get an array of rates in country code => rates format
Rates::all();

// Validate a VAT number by both format and existence
Validator::validate('NL50123'); // false

// Validate VAT number by format only
Validator::validateFormat('NL203458239B01'); // true

// Validate VAT number by existence (uses a remote HTTP service)
Validator::validateExistence('NL203458239B01') // false

// Get array of ISO-3316 country codes and country names
Countries::all(); // array of country codes + names

// Get name of country by ISO-3316 code
Countries::name('NL') // Netherlands

// Get array of EU country codes + names
Countries::europe(); // array of EU country codes + names

// Check if ISO-3316 code is in EU
Countries::inEurope('NL'); // true

// Get ISO-3316 code by IP address geo-location
Countries::ip('8.8.8.8'); // US
```

By default, VAT rates are cached for 24 hours using the default cache driver.

#### Validation

[](#validation)

The package registers two new validation rules.

**vat\_number**

The field under validation must be a valid and existing VAT number.

**country\_code**

The field under validation must be a valid ISO-3316 alpha-2 country code.

```
use Illuminate\Http\Request;

class Controller {

    public function foo(Request $request)
    {
        $request->validate([
            'vat_number_field' => ['vat_number'],
            'country_code_field' => [ 'country_code' ],
        ]);
    }
}
```

Alternatively, you can also use the `Rule` objects directly.

```
use Illuminate\Http\Request;
use DvK\Laravel\Vat\Rules;

class Controller {

    public function foo(Request $request)
    {
        $request->validate([
            'vat_number_field' => [ new Rules\VatNumber() ],
            'country_code_field' => [ new Rules\Country() ],
        ]);
    }
}
```

Localization
------------

[](#localization)

You can translate the validation error message by [Using Translation Strings As Keys](https://laravel.com/docs/6.x/localization#using-translation-strings-as-keys) for the following strings:

`resources/lang/de.json`

```
{
    "The :attribute must be a valid VAT number.": "Your translation for the VatNumber Rule",
    "The :attribute must be a valid country.": "Your translation for the Country Rule"
}

```

License
-------

[](#license)

[MIT licensed](LICENSE).

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 80.8% 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 ~182 days

Recently: every ~233 days

Total

12

Last Release

1473d ago

Major Versions

1.1.0 → 2.0.02019-01-08

PHP version history (3 changes)1.0PHP &gt;=5.6

1.1.0PHP &gt;=7.0

2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/885856?v=4)[Danny van Kooten](/maintainers/dannyvankooten)[@dannyvankooten](https://github.com/dannyvankooten)

---

Top Contributors

[![dannyvankooten](https://avatars.githubusercontent.com/u/885856?v=4)](https://github.com/dannyvankooten "dannyvankooten (63 commits)")[![quodos](https://avatars.githubusercontent.com/u/1292173?v=4)](https://github.com/quodos "quodos (2 commits)")[![LKaemmerling](https://avatars.githubusercontent.com/u/4281581?v=4)](https://github.com/LKaemmerling "LKaemmerling (2 commits)")[![marijnbent](https://avatars.githubusercontent.com/u/11903095?v=4)](https://github.com/marijnbent "marijnbent (2 commits)")[![jochensengier](https://avatars.githubusercontent.com/u/10118729?v=4)](https://github.com/jochensengier "jochensengier (1 commits)")[![Lednerb](https://avatars.githubusercontent.com/u/2056876?v=4)](https://github.com/Lednerb "Lednerb (1 commits)")[![paulhennell](https://avatars.githubusercontent.com/u/4799852?v=4)](https://github.com/paulhennell "paulhennell (1 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![m2de](https://avatars.githubusercontent.com/u/17720020?v=4)](https://github.com/m2de "m2de (1 commits)")[![dnlmr](https://avatars.githubusercontent.com/u/2418514?v=4)](https://github.com/dnlmr "dnlmr (1 commits)")[![mbardelmeijer](https://avatars.githubusercontent.com/u/1583095?v=4)](https://github.com/mbardelmeijer "mbardelmeijer (1 commits)")[![ErikDohmen](https://avatars.githubusercontent.com/u/39862207?v=4)](https://github.com/ErikDohmen "ErikDohmen (1 commits)")[![felixgoldstein](https://avatars.githubusercontent.com/u/1301766?v=4)](https://github.com/felixgoldstein "felixgoldstein (1 commits)")

---

Tags

laravelvat

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[tonysm/importmap-laravel

Use ESM with importmap to manage modern JavaScript in Laravel without transpiling or bundling.

148399.8k1](/packages/tonysm-importmap-laravel)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)

PHPackages © 2026

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