slimad/eori
A Laravel package for working with EORI numbers, the EU customs identifier for traders. It provides validation rules, normalization, and country-prefix checks so you can verify economic operator IDs in forms, imports, and API requests with minimal setup.
Architecture fit. slimad/eori is a single-purpose Laravel validation package. Its natural seat is the input-validation layer: a FormRequest, a Rule object, or a Filament/Livewire field validator on any onboarding, KYC, or B2B registration flow that captures an EU customs identifier. Footprint is small and stateless, which is good — it does not introduce a service, queue, or persistence concern by itself.
The critical architectural distinction is syntax validation vs. existence validation. EORI format is country-prefixed (2-letter ISO country + up to 15 alphanumerics) with per-member-state rules. Existence checking requires a call to the European Commission's EORI registry, which is network-bound, rate-limited, and has no consumer SLA. These two behaviors belong in different layers: format checks are safe in synchronous request validation; existence checks must be asynchronous (queued job, cached result, retry policy) or they will degrade your p95 latency and couple your onboarding to a third-party endpoint. Confirm which one the package implements before committing to an integration point.
Integration feasibility. Low-effort. Standard Composer install, Laravel package auto-discovery, likely a publishable config and a rule alias. A single engineer can spike it in an afternoon. The real work is not integration but verification: the release (2024-07-16) predates Laravel 12, so the Composer constraints against your PHP/Laravel matrix must be checked explicitly rather than assumed.
Technical risk.
Key questions to answer before approval.
composer.json? Is there a CI matrix?Stack fit. Conventional Laravel package shape: service provider, config, validation rule. Drops into existing FormRequest rules, custom Rule objects, API request validation, and admin-panel validators without touching your domain layer. No conflict with typical Laravel stacks.
Migration path. There is nothing to migrate from — this is greenfield. Equally, the exit cost is near zero: a per-country regex table plus a rule class is roughly a day of work in-house. Treat the package as a convenience, not a dependency. The decisive move is to wrap it behind your own EoriValidator contract so that swapping to an in-house implementation, or to a different package, is a one-class change and not a codebase sweep.
Compatibility. Pin an exact version in composer.json rather than floating. Add it to your dependency-review checklist and run its suite (or your own contract tests) against your supported Laravel/PHP matrix in CI. If you are on Laravel 12, assume incompatibility until proven otherwise and verify explicitly.
Sequencing.
Maintenance. Code churn is likely minimal, but the data is perishable. Budget roughly half a day per year to re-verify the country-format table against current EU and UK rules, and a defined trigger to review whenever EU membership or customs arrangements change. Because it is MIT with no dependents, the realistic path on abandonment is to fork the rule class and own it — cheap, but should be a documented decision, not an improvisation.
Support. Community-only. No vendor, no SLA, no escalation path beyond the maintainer's inbox. Operational ownership of any incident defaults to your own team, so the runbook must assume internal diagnosis.
Scaling. Format validation is CPU-trivial, stateless, and horizontally safe — negligible cost at any realistic volume. If existence checks are in play, throughput is bound by the Commission's endpoint, not by your infrastructure: cache positive and negative results with a sane TTL, batch where possible, and keep lookups out of the synchronous request path for bulk onboarding or imports.
Failure modes and mitigations.
Ramp-up. Hours for any Laravel developer to integrate; roughly a day to do it properly with the adapter, fixtures, and feature flag. The knowledge that must persist is small but specific: which EORI formats are covered, whether existence checks occur, and what the failure policy is. Put those three facts in the runbook — they are the only things a responder will need when EORI validation starts rejecting valid customers at 2 a.m.
How can I help you explore Laravel packages today?