nysander/amukana-plvalidator-bundle
Symfony bundle that wraps Polish validation rules (PESEL, NIP, REGON and similar) as constraints for the Validator component, so you can validate forms and entities via annotations, attributes or YAML. Installs with Composer and registers its services automatically, keeping Polish-specific checks ou...
What it actually is. Despite being framed as a "Laravel/PHP package," nysander/amukana-plvalidator-bundle is a Symfony bundle (name, structure, and DependencyInjection conventions all indicate this). It ships validation constraints for Polish identifiers: PESEL (national ID, encodes date of birth and gender), NIP (tax ID), REGON (business registry number, 9- and 14-digit variants), Polish identity card numbers, and IBAN/NRB bank account numbers. There is no Laravel service provider, no Rule object, and no laravel/framework constraint.
Architecture fit — poor as a dependency, fine as a reference implementation. A Symfony bundle sits in the wrong abstraction layer for a Laravel or framework-agnostic codebase. Adopting it means either (a) pulling symfony/validator and its transitive graph into a Laravel app that already has its own validator, duplicating infrastructure and error-handling semantics, or (b) forking the constraint classes and rewriting the glue. The actual computational payload — modular checksum arithmetic over digit strings — is a few hundred lines with no framework coupling. The architectural value of the package is near zero; the domain knowledge embedded in it is the only asset.
Integration feasibility — low friction technically, low value strategically. All five validators are deterministic, publicly specified algorithms (PESEL weighted checksum, NIP weights 6,5,7,2,3,4,5,6,7, REGON 9/14 check digits, IBAN mod-97). A mid-level PHP developer can reimplement and test all five in 3–5 days including official test vectors. That sets the ceiling on what this package can save you.
Technical risk — high, concentrated in abandonment.
symfony/validator nor a PHP floor, meaning undeclared transitive assumptions. Expect PHP 5.6/7.x-era syntax that may fail on PHP 8.2+ (dynamic properties, missing return types, deprecated each/curly-brace offsets).Key questions before any further investment.
composer.json actually require — PHP version, Symfony version, declared deps? Does it install and execute at all on PHP 8.2/8.3?Recommendation: do not adopt as a runtime dependency. Use it as a readability reference, extract the checksum logic into an in-house, framework-agnostic pl-identifiers utility, and own it. If a maintained alternative exists (a symfony/validator constraint set on an active release, or a standalone PHP identifier-validation library), prefer it.
Stack fit. None for Symfony-in-Laravel. The correct shape for a Laravel codebase is a set of custom validation rules (php artisan make:rule PeselRule) backed by pure-PHP value objects, registered via Validator::extend or attribute-style Rule classes. That preserves Laravel's error message, translation, and $request->validate() idioms, and keeps validation failures consistent with the rest of the form layer.
Migration path (from "consider this package" to "we own it").
| Step | Activity | Owner | Effort |
|---|---|---|---|
| 1 | Spike: clone, install on current PHP, run against 20 real-world identifiers | Backend | 0.5 day |
| 2 | Extract checksum algorithms into framework-free classes under our namespace | Backend | 2 days |
| 3 | Build Laravel Rule wrappers + translation keys (validation.pesel, validation.nip, …) |
Backend | 1 day |
| 4 | Build a test-vector suite from authoritative sources (GUS for REGON, MF for NIP, published PESEL examples, IBAN mod-97) | Backend + QA | 1 day |
| 5 | Normalise input at the boundary: strip spaces/hyphens, uppercase, reject non-ASCII lookalikes | Backend | 0.5 day |
| 6 | Publish as an internal Composer package or a app/Support/Validation module |
Backend | 0.5 day |
Total: under two weeks, versus an indefinite maintenance liability for a 7-star archived bundle.
Compatibility. Target a PHP floor and a Laravel major explicitly (laravel/framework: ^10|^11, php: ^8.2) and pin them. Do not carry the bundle's constraint declarations forward — they will be stale or absent.
Sequencing. Do not place this on a critical path. Slot it inside the "Polish market onboarding / PL locale compliance" epic, after the form and data-model decisions are settled, because the validation shape depends on whether you store PESEL as a hash, a masked string, or not at all. If the product only needs to display a Polish tax ID on an invoice, checksum validation may not be a requirement at all — confirm the requirement before building.
One product-level note the package cannot help with. Checksum validation answers "does this look like a valid PESEL/NIP/REGON," not "does this person or company exist." If the business case is KYC or B2B onboarding, the real integration is a registry lookup (GUS REGON API, the Ministry of Finance VAT whitelist), and local validation is a cheap pre-filter that reduces lookup cost and error noise. Frame it that way to stakeholders; otherwise "we validate NIP" will be heard as "we verify counterparties."
Maintenance. Adopting the bundle means inheriting an unmaintained component with no upgrade path. Every PHP or Laravel major bump becomes an internal fork-and-patch exercise — cheap per instance, but recurring and poorly tracked. Owning ~400 lines of checksum code with a frozen, fully-specified algorithm set is close to zero-maintenance by comparison; these algorithms do not change.
Support. No maintainer, no issue triage, no upstream answers. Any defect becomes an internal debugging task against opaque third-party code. Conversely, an in-house implementation means the person who understands PESEL month-offset encoding is on your team — a real operational advantage when a customer disputes a rejected identifier.
Scaling. Effectively zero concern. String inspection and modular arithmetic are CPU-trivial; even form-heavy traffic is negligible next to I/O. If PESEL is ever used inside a high-volume ingestion path, batch validation should be run once at ingestion, not per row read. No caching layer, queue, or external call is involved.
Failure modes to design for.
Log::debug payloads can leak PESEL. Mask it in exception handlers and validation output; make this an explicit acceptance criterion, not a code-review nicety.Ramp-up. Small. A backend developer unfamiliar with Polish identifiers can reach competence in a day: the specifications are public, the checksums are simple, and the official registries publish test data. The domain ramp-up is not the risk — the risk is that a 30-minute "just install the bundle" decision quietly commits the team to owning an abandoned dependency for the life of the product. Cost the in-house build in the epic; it is the cheaper and lower-variance option.
How can I help you explore Laravel packages today?