PHPackages                             pilou/eu-vat-id-validation - 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. pilou/eu-vat-id-validation

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

pilou/eu-vat-id-validation
==========================

EU VIES VAT Validation

0.2.4(9y ago)02.5kPHPPHP &gt;=5.4

Since Oct 27Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (9)Used By (0)

Getting Started
---------------

[](#getting-started)

`composer require pilou/eu-vat-id-validation`

---

Options / Functions
-------------------

[](#options--functions)

#### \_\_construct()

[](#__construct)

- param: `string` $vatId *\[optional\]*

---

#### setVatId()

[](#setvatid)

- param: `string` $vatId
- throws: `\Exception`

Sets the current VAT-ID value and extracts the VAT-Number and the country code from it.

---

#### getVatId()

[](#getvatid)

- return: `string`

Gets the last set VAT-ID value.

---

#### toArray()

[](#toarray)

- return: `array`

Gets the last set VAT-ID value and all associated details:

- VAT-ID
- VAT-Number
- Country code
- Is valid?
- Company name *(not always available)*
- Company address *(not always available)*

Example:

```
Array (
    [vatId] => IT01775560442
    [vatNumber] => 01775560442
    [countryCode] => IT
    [isValid] => 1
    [companyName] => M.A.B. SOFTWARE SRL
    [companyAddress] => C DA CAMPIGLIONE 20 63900 FERMO FM
)
```

---

#### isValid()

[](#isvalid)

- return: `boolean`
- throws: '\\Pilou\\EuVat\\ServiceUnavailableException'

---

Usage Examples
--------------

[](#usage-examples)

Check if passed VAT-ID is valid:

```
$vatId = new \Pilou\EuVat\Validation('IT01775560442');
print_r($vatId->isValid());

// Output
true
```

---

Check multiple VAT-ID's:

```
$vatId = new \Pilou\EuVat\Validation;

$vatId->setVatId('IT01775560442');
print_r($vatId->isValid());             // Output: true

$vatId->setVatId('XX123456789');
print_r($vatId->isValid());             // Output: false
```

---

Display all VAT-ID details:

```
$vatId = new \Pilou\EuVat\Validation('IT01775560442');
print_r($vatId->toArray());

// Output
Array (
    [vatId] => IT01775560442
    [vatNumber] => 01775560442
    [countryCode] => IT
    [isValid] => 1
    [companyName] => M.A.B. SOFTWARE SRL
    [companyAddress] => C DA CAMPIGLIONE 20 63900 FERMO FM
)
```

---

Using all public class functions:

```
$vatId = new \Pilou\EuVat\Validation;
$vatId->setVatId('IT01775560442');
$vatId->validate();

print_r($vatId->isValid());             // Output: true
print_r($vatId->getVatId());            // Output: 'IT01775560442'

print_r($vatId->toArray());

// Output
Array (
    [vatId] => IT01775560442
    [vatNumber] => 01775560442
    [countryCode] => IT
    [isValid] => 1
    [companyName] => M.A.B. SOFTWARE SRL
    [companyAddress] => C DA CAMPIGLIONE 20 63900 FERMO FM
)
```

---

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

8

Last Release

3454d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.5

0.2.4PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe2e4ef1362f2ac93eb3e33e2e386c66065dc75645e7bc382e168947267a6e4c?d=identicon)[pilou](/maintainers/pilou)

---

Top Contributors

[![miljan-aleksic](https://avatars.githubusercontent.com/u/513275?v=4)](https://github.com/miljan-aleksic "miljan-aleksic (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pilou-eu-vat-id-validation/health.svg)

```
[![Health](https://phpackages.com/badges/pilou-eu-vat-id-validation/health.svg)](https://phpackages.com/packages/pilou-eu-vat-id-validation)
```

###  Alternatives

[webmozart/assert

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

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M450](/packages/nette-forms)[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)

PHPackages © 2026

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