eufaturo / vat-number-validator
PHP Vat Number Validator
dev-main / 1.0.x-dev
2025-02-08 14:39 UTC
Requires
- php: ^8.3
Requires (Dev)
- eufaturo/coding-standards: ^0.1
- phpunit/phpunit: ^11.0|^12.0
This package is auto-updated.
Last update: 2025-03-08 14:51:15 UTC
README
Introduction
This is a simple yet modern PHP library to validate VAT numbers.
The API is overall simple and returns a true
or false
boolean.
Code Samples
In order to use this library, you simply need to import and initialize the VatNumberValidator
class.
Then just call the validate
method and pass the VAT number you want to validate as it's sole argument.
<?php use Eufaturo\VatNumberValidator\VatNumberValidator; $validator = new VatNumberValidator(); $isValid = $validator->validate( vatNumber: 'PT100000010', );
Installation
This library is installed via Composer and to install, run the following command.
composer require eufaturo/vat-number-validator
Testing
composer test
Contributing
Thank you for your interest. Here are some of the many ways to contribute.
- Check out our contributing guide
- Look at our code of conduct
License
This library is open-sourced software licensed under the MIT license.
Inspiration
This library was inspired by https://github.com/antalaron/vat-number-validator.