worksome / uk-tax-code-validator
A package for validating tax codes in UK
Installs: 469 105
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 17
Forks: 2
Open Issues: 0
Requires
- php: ^8.3
- illuminate/contracts: ^11.0 || ^12.0
- illuminate/pipeline: ^11.0 || ^12.0
- thecodingmachine/safe: ^2.5 || ^3.0
Requires (Dev)
- larastan/larastan: ^3.1
- nunomaduro/collision: ^7.10 || ^8.1.1
- orchestra/testbench: ^9.12 || ^10.1
- pestphp/pest: ^3.7
- pestphp/pest-plugin-laravel: ^3.1
- worksome/coding-style: ^3.2
README
This package is for validating if a UK tax code is valid.
As there are many rules for when a UK tax code is valid, we needed a way to actually check this.
This package contains all the rules for validating if the UK tax code is a valid or not.
Usage
For validating a tax code, you can simply run the following
$engine = new Engine(); $response = $engine->validate($taxCode); $response->isValid();
Laravel
The package does also contain a validation rule to be used with Laravel.
Validator::make($data, [ 'tax_code' => ['required', new UkTaxCode(),], ])->fails();