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

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

kfoobar/laravel-euro-vat
========================

A Laravel package for Euro VAT validation

v1.0.1(2mo ago)19↓90%MITPHPPHP &gt;=8.1

Since Mar 26Pushed 2mo agoCompare

[ Source](https://github.com/KFoobar/laravel-eu-vat)[ Packagist](https://packagist.org/packages/kfoobar/laravel-euro-vat)[ Docs](https://github.com/kfoobar/laravel-euro-vat)[ RSS](/packages/kfoobar-laravel-euro-vat/feed)WikiDiscussions main Synced 3w ago

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

Laravel EU VAT Validator
========================

[](#laravel-eu-vat-validator)

A Laravel package for validating EU VAT numbers, including local format validation and online validation against the EU VIES API.

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

[](#installation)

Install the package via Composer:

```
composer require kfoobar/laravel-euro-vat
```

Publish the configuration file:

```
php artisan vendor:publish --provider="KFoobar\EuroVAT\EuroVATServiceProvider"
```

Configuration
-------------

[](#configuration)

The configuration file `config/euro-vat.php` allows you to set:

- `urls.number`: Endpoint used when validating a VAT number online.
- `urls.status`: Endpoint used for the VIES status check.
- `ttl.number`: Cache lifetime in minutes for VAT validation results.
- `ttl.status`: Cache lifetime in minutes for VIES status results.

Usage
-----

[](#usage)

The main service exposes:

- `validate(string $number, ?string $country = null): ?string`
- `validateOffline(string $number, ?string $country = null): ?string`
- `validateOnline(string $number, string $country): ?string`
- `status(?string $country = null): bool`

### Using the Facade

[](#using-the-facade)

Validate a VAT number:

```
use KFoobar\EuroVAT\Facades\EuroVAT;

EuroVAT::validate('SE123456789012');
EuroVAT::validateOffline('SE123456789012');
EuroVAT::validateOnline('123456789012', 'SE');
EuroVAT::validate('123456789012', 'SE');
EuroVAT::status('SE');
```

`validate()` is the default entrypoint and performs online validation.

`validateOffline()` only performs the local VAT format check. No external HTTP request is made.

`validateOnline()` sends the provided VAT number and country code directly to the EU VIES API and caches the response. It does not normalize or pre-validate the VAT number locally.

### Using the Validation Rule

[](#using-the-validation-rule)

```
use KFoobar\EuroVAT\Rules\VatId;

$request->validate([
    'vat_number' => ['required', new VatId('SE')],
]);
```

### Using the `vat_id` Validator Extension

[](#using-the-vat_id-validator-extension)

```
$request->validate([
    'vat_number' => 'required|vat_id:SE',
]);
```

Contributing
------------

[](#contributing)

Contributions are welcome!

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance83

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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 ~6 days

Total

2

Last Release

87d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/420690?v=4)[David Villa](/maintainers/KFoobar)[@KFoobar](https://github.com/KFoobar)

---

Top Contributors

[![KFoobar](https://avatars.githubusercontent.com/u/420690?v=4)](https://github.com/KFoobar "KFoobar (3 commits)")

---

Tags

laravelvalidationvatvieseu vat

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M50](/packages/proengsoft-laravel-jsvalidation)[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

761621.7k17](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2422.3M6](/packages/laravel-validation-rules-credit-card)[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

97485.7k1](/packages/ph-7-eu-vat-validator)

PHPackages © 2026

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