ddeboer/vatin

Validate VAT identification numbers

Maintainers

Details

github.com/ddeboer/vatin

Source

Issues

Installs: 311 642

Dependents: 4

Suggesters: 1

Stars: 81

Watchers: 10

Forks: 19

Open Issues: 1

2.2.0 2019-01-05 14:49 UTC

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

A small PHP library for validating VAT identification numbers (VATINs).

Installation

This library is available on Packagist:

$ composer require ddeboer/vatin

If you want to use this library in a Symfony application, you can use the VatinBundle instead.

Usage

Validate a VAT number’s format:

use Ddeboer\Vatin\Validator;

$validator = new Validator;
$bool = $validator->isValid('NL123456789B01');

Additionally check whether the VAT number is in use, with a call to the [VAT Information Exchange System (VIES)] (http://ec.europa.eu/taxation_customs/vies/faq.html#item_16) SOAP web service:

use Ddeboer\Vatin\Validator;

$validator = new Validator;
$bool = $validator->isValid('NL123456789B01', true);