barbieswimcrew/zip-code-validator
Validate postal and zip codes with country-specific rules. This package adds Laravel validation support for dozens of countries, using accurate regex patterns plus an extensible interface for defining your own formats.
Architecture fit
Constraint plus a country-code lookup service that returns postal-code patterns/regexes. It is a validation primitive, not a platform component — no persistence, no HTTP calls, no queue/event surface.Rule objects, or a shared address DTO/value object. It slots in as a leaf dependency in the domain layer with no framework coupling beyond the Symfony Validator contract.Integration feasibility
Rule or a Validator::extend closure that instantiates the constraint and maps violations to messages) is required. That adapter is roughly a day of work including tests — small, contained, and independently testable.symfony/validator range must be co-resolvable with the Laravel/illuminate versions in use. Verify on the oldest and newest supported framework versions before committing.Technical risk
Key questions
symfony/validator and PHP, and does it resolve against our Laravel matrix?Stack fit
app/Rules/ValidPostalCode.php implementing Illuminate\Contracts\Validation\Rule, taking an ISO-3166 alpha-2 country code (usually derived from the same address form, not from user input independently).Migration path
Rule, plus a fixture set of valid/invalid codes per priority country sourced from real order data and national postal references. Target >95% agreement with manual review on the fixture set.Compatibility
null/empty handling (required-vs-optional must be enforced by our rules, not the package).Sequencing
Maintenance
Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?