cosmin-ciolacu / eu-vat-number-validator
An simple validator for EU vat numbers with validation rule for requests
1.0.4
2024-08-02 09:20 UTC
Requires
- illuminate/support: ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ~7
- phpunit/phpunit: ~9.0
README
A simple EU VAT number validator and validation rule for Laravel.
Installation
Via Composer
composer require cosmin-ciolacu/eu-vat-number-validator
Usage
use CosminCiolacu\EuVatNumberValidator\EuVatNumberValidator; $vatNumber = 'RO123456789'; $isValid = EuVatNumberValidator::validate($vatNumber); if ($isValid) { echo 'VAT number is valid'; } else { echo 'VAT number is not valid'; }
You can use in laravel validation rules like this:
use CosminCiolacu\EuVatNumberValidator\Rules\EUVatNumberValidationRule; $rules = [ 'vat_number' => ['required', new EUVatNumberValidationRule] ]; $validator = Validator::make($request->all(), $rules);
Change log
Please see the changelog for more information on what has changed recently.
Testing
composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email cosminnciolacu99@gmail.com instead of using the issue tracker.
Credits
- [Cosmnin Ciolacu][link-author]
- [All Contributors][link-contributors]
License
MIT. Please see the license file for more information.