richbarrett / eori-validator
Validate GB and EU EORI numbers
1.4
2025-01-15 16:38 UTC
Requires
- php: >=5.6.0
- ext-curl: *
- ext-soap: *
This package is not auto-updated.
Last update: 2025-04-23 18:04:49 UTC
README
Overview
This uses the following resources to validate GB and EU origin EORI numbers.
- https://ec.europa.eu/taxation_customs/dds2/eos/eori_validation.jsp?Lang=en
- https://www.gov.uk/check-eori-number
Usage
<?PHP try { echo \eorivalidator\eori::validate('GB981509987000') ? 'Valid' : 'NOT Valid'; } catch (\eorivalidator\serviceNotAvailableException $e) { die('The required web service was unavailable'); } catch (\eorivalidator\malformedEoriNumber $e) { die('Your EORI number was not formed correctly: '.$e->getMessage()); } ?>