Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zipcode Laravel Package

pragmarx/zipcode

pragmarx/zipcode is a Laravel package for validating and formatting postal codes. It provides country-aware zip code rules and helpers, making it easy to add reliable address and postal-code handling to forms, APIs, and applications.

View on GitHub
Deep Wiki
Context7

Zip code searcher

Frequently asked questions about Zipcode
How do I install pragmarx/zipcode in a Laravel application?
Install it with Composer using composer require pragmarx/zipcode, then register the package service provider if your Laravel version does not auto-discover it. Publish any provided config file so you can set API keys and default country behavior. Because the package is an older release, verify the Composer constraints resolve against your current PHP and Laravel baseline before wiring it into application code.
Which Laravel and PHP versions does pragmarx/zipcode support?
The available evaluation flags this as a 2019-era release, so its declared Illuminate and PHP constraints likely target older framework versions. Do not assume compatibility with current Laravel releases; run a Composer dry-run or a short spike against your exact PHP and Laravel versions. If constraints conflict, expect to fork the package or vendor it with adjusted requirements.
Does pragmarx/zipcode really validate postal codes worldwide?
The package markets country-aware zip code rules, but the worldwide claim should be validated country by country rather than accepted at face value. Postal-code formats, ambiguity, and coverage vary significantly between countries, and external provider data quality affects results. Test representative postal codes for every target country before relying on it for validation or address enrichment.
Does pragmarx/zipcode call external geocoding or postal-code APIs?
The package is positioned as a zip code searcher, which implies it depends on external postal or geocoding providers for lookup data. That means API keys, quotas, provider terms of service, and data-retention rules are all part of your integration. Confirm which providers it calls and whether those services are still active before committing to it.
Is pragmarx/zipcode safe to use in production?
Treat it as high risk for critical paths: it has a stale release, low ecosystem signals, and reliance on external providers. It is reasonable for a non-critical prototype, internal lookup, or address enrichment feature behind a feature flag. For production, wrap it behind an internal interface, add caching, retries, timeouts, and graceful degradation, and budget for ongoing ownership.
How do I keep pragmarx/zipcode from becoming a hard dependency in my Laravel code?
Define an internal AddressLookupService interface and put all package-specific calls in a single adapter that implements it. Controllers, models, and business logic should depend only on your interface and your own response objects, not on the package's facades, config, or response shapes. That way you can replace the package with direct provider integrations or a fork without changing callers.
How can I test zip code validation without hitting external providers?
Write contract tests against your AddressLookupService interface and use fake or recorded responses in place of real provider calls. Keep a small fixture set of representative postal codes for your target countries, including ambiguous and invalid cases. This isolates your test suite from provider outages, rate limits, and API-key requirements.
What are good alternatives to pragmarx/zipcode for Laravel postal code validation?
For simple format validation, Laravel's built-in regex and rule objects or a small country-format rule set may be enough without any dependency. For address lookup, direct integrations with a maintained geocoding or postal provider, wrapped in your own adapter, usually offer better support and clearer terms. Evaluate alternatives on country coverage, licensing, data-retention rules, and Laravel version support.
How should I handle rate limits, timeouts, and provider outages with pragmarx/zipcode?
Cache results by normalized postal code and country, set explicit HTTP timeouts, and add retry and backoff logic around provider calls. Enqueue enrichment where possible so user requests are not blocked by third-party latency, and define a fallback for when a provider fails or returns ambiguous data. Alert on quota exhaustion and expired API keys, and degrade the feature gracefully rather than failing the whole request.
Is pragmarx/zipcode still maintained, and should we fork it?
The available evaluation shows no strong maintenance signals, so assume community-only support with no vendor SLA. Start with a time-boxed spike, pin the version, and validate real target-country data before broader adoption. If the package proves useful but incompatible or unmaintained, fork it and treat the fork as an internal dependency with ownership, tests, and a patch policy.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core