jongotlin/identity-number-bundle
Symfony bundle that integrates jongotlin/identity-number into your app, adding validator constraints and service wiring to check national identity numbers across supported countries, including format and checksum validation for forms and domain models.
Architecture fit — Nominally poor at the framework boundary, sound at the domain boundary. This is a Symfony bundle: its value is a DI extension, form types, and symfony/validator constraint classes. A Laravel application has no service provider, facade, or Illuminate\Validation\Rule integration here, so the bundle itself is dead weight in our stack and pulls a framework we do not run. The reusable asset is the underlying jongotlin/identity-number library, which is plain PHP and therefore stack-agnostic. Treat the bundle as a worked example of intended usage, not as an installable dependency.
Integration feasibility — High on the library path, low on the bundle path. composer require jongotlin/identity-number, then author a ValidationRule, an error message, and a singleton binding is a day's work for a mid-level engineer. The bundle path requires either running Symfony components inside Laravel or forking the constraint, both of which cost more than rewriting the ~100 lines of checksum logic. The decision is not close.
Technical risk — The dominant risks are provenance and documentation, not algorithms.
+/- separator semantics for individuals over 100, coordination-day offset (+60), organisation-number prefix ranges, and reserved test ranges. Missing any of these produces false rejections of legitimate users, the highest-severity failure at signup.Key questions
symfony/*, and does that resolve against our target Laravel version?false on malformed input, or throw?Stack fit — Clean. Pure PHP string and arithmetic logic, no I/O, no persistence, no async, no native extensions. It fits Laravel 9/10/11 on the library path. The only Laravel-native artifacts we author are a ValidationRule, a message key, and optionally a cast or value object so a validated number cannot re-enter the domain as a raw string.
Migration path — Three realistic entry states:
Compatibility — Verify php and any transitive symfony/validator constraint against the target Laravel version before anything else. If the bundle forces a Symfony major that conflicts with Laravel's own transitive Symfony components, the bundle path is disqualified outright and the library path is confirmed. MIT licensing means vendoring or forking with attribution is a legitimate and probably preferred fallback.
Sequencing
ValidationRule plus a fixture corpus: valid and invalid numbers for each type, plus coordination numbers and malformed/whitespace inputs.Maintenance — Budget for ownership transfer, not dependency management. Pin the version, calendar a periodic upstream review, and keep a documented fork contingency. The code is small enough to read in one sitting, which is exactly what makes vendoring cheap and makes leaving it unexamined indefensible.
Support — There is no vendor, no community, and no SLA. That means internal documentation of the rule's semantics, its error messages, and — critically — the line between format validation and identity verification is mandatory, not optional. Compliance and support teams will test that line, and a support agent who believes a passing check means "verified person" is a regulatory incident waiting to happen. Provide a manual-override path in support tooling for legitimate users who fail the check.
Scaling — Effectively free. Microseconds of CPU per call, no network or database round trips, trivially cacheable, no capacity planning required. This is true even at signup-spike volumes.
Failure modes
Ramp-up — Hours for a mid-level Laravel engineer to wire the rule and binding; the real learning curve is Swedish (or South African) identity-number domain knowledge, not PHP. Source test numbers from the issuing authority's published test ranges rather than inventing them, and encode them as CI fixtures so the knowledge lives in the repository rather than in one engineer's head.
How can I help you explore Laravel packages today?