richbarrett/eori-validator

Validate GB and EU EORI numbers

1.4 2025-01-15 16:38 UTC

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.

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());
  
}

?>