ndevs-eu/geo-ip-bundle
A Symfony bundle for IP-based geolocation with MaxMind GeoIP2. Detect visitor country, locale, and currency from IP addresses, configure database paths, and use Twig helpers for geo-aware routing, redirects, and localized content.
GeoResponse and reading the two new fields: countryName for display and countryIsoCode for application logic such as locale selection, tax/shipping rules, or access policies.GeoResponse class. The GeoResponse object is the main integration point; v1.0.16 adds countryName and countryIsoCode without indicating breaking changes.GeoResponse, and confirm how the new fields are serialized before wiring them into persistence or views.GeoResponse to the request or container. Avoid repeated lookups for the same IP in controllers, views, and listeners.countryIsoCode in business logic; use countryName only when rendering human-readable output. This keeps behavior stable if the display name changes or is localized differently.countryIsoCode to a supported Laravel locale and call App::setLocale() early in the request lifecycle. Fall back to the application default when the response is missing, the IP is private, or the country is unsupported.GeoResponse or just the fields you need (countryIsoCode, countryName, and any other used fields) with a TTL that respects the provider’s terms and your accuracy requirements. This is especially important for high-traffic pages.countryName at render time or through your own translation layer so display naming remains consistent across the app.countryName in views and API resources for display, and expose countryIsoCode as a stable machine-readable field. Normalize the output shape in your own resource rather than relying directly on the package’s array/JSON format.GeoResponse in the container for feature tests so tests do not depend on external geo services. Assert both the new fields and your fallback behavior when they are absent or null.127.0.0.1, ::1), Docker networks, and private ranges often produce no country data. Always null-check the GeoResponse and both new fields before using them.countryIsoCode as an ISO 3166-1 alpha-2 code and normalize case where needed. If you compare it to stored values, decide on uppercase and apply that consistently; avoid case-sensitive comparisons against user input.countryName may be English-only or provider-localized depending on configuration. Do not assume it matches Laravel’s translation files; use it as a fallback and prefer your own translation keys when you need multilingual display.countryName / countryIsoCode on the object but as country_name / country_iso_code in arrays or JSON, depending on the package’s serialization. Inspect toArray()/JSON output before depending on exact keys in API contracts or strict tests.php artisan config:clear. In production, remember that cached config can mask new environment variables.GeoResponse fields, no stated removals or signature changes. It should be a low-risk upgrade, but pin the version if you have strict tests around response shape or serialized payloads.How can I help you explore Laravel packages today?