richbarrett/eori-validator

Validate GB and EU EORI numbers

Installs: 33

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/richbarrett/eori-validator

1.4 2025-01-15 16:38 UTC

This package is not auto-updated.

Last update: 2025-10-08 20:02:45 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());
  
}

?>