richbarrett/eori-validator

Validate GB and EU EORI numbers

1.3 2021-10-04 13:57 UTC

This package is not auto-updated.

Last update: 2024-05-14 01:53:04 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());
  
}

?>