ambersive / vatvalidator
Wrapper for using the api from https://ec.europa.eu/taxation_customs/vies/ to validate a vat id.
Requires
- illuminate/support: 6.*|7.*|8.*
- phlak/semver: ^3.2
Requires (Dev)
- php: >=7.4
- illuminate/support: 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
- laravel/framework: 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
- orchestra/testbench: 3.8.*|4.*|5.*|6.*
- phpunit/phpunit: ^9.3@dev
This package is auto-updated.
Last update: 2024-12-09 03:39:18 UTC
README
Validating the vat id from another company is a requirement within the european union. This package validates the vat id + give you further information about the company behind the vat id. The CHANGELOG offers an overview ob the changes done by us.
Installation
composer require ambersive/vatvalidator
Optional: Publish the config
php artisan vendor:publish --tag=vat-validator
Usage
This package comes with a Facade so using this functionality if easy.
use VatValidator; $result = VatValidator::check("ATU69434329");
The result is typed an will return you a VatCompany Class. This class offers you following methods:
$result->isValid(); // Returns a boolean value $result->getName(); // Returns the company name $result->getAddress(); // Returns the company address $result->getCountry(); // Returns the Country code $result->getNumber(); // Returns the TAX number.
Validation rule
This package also offers you a validation rule you there would be no need to do all that stuff manually.
$validator = Validator::make(['vatid' => 'ATU69434328'], [ 'vatid' => 'vat_eu' ]);
Behind the scene
This package is using the CheckVat Service from the european union to check if a tax id is valid. It is a soap client, so make sure your server is ready for soap class.
Feedback
Please feel free to give us feedback or any improvement suggestions.
Security Vulnerabilities
If you discover a security vulnerability within this package, please send an e-mail to Manuel Pirker-Ihl via manuel.pirker-ihl@ambersive.com. All security vulnerabilities will be promptly addressed.
License
This package is open-sourced software licensed under the MIT license.