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

Geocoder Laravel Laravel Package

toin0u/geocoder-laravel

Geocoder for Laravel integrates the Geocoder PHP library into Laravel apps, enabling address geocoding and reverse geocoding with configurable providers and caching. Requires PHP 8.2+ and Laravel 11+, with service provider auto-discovery for quick setup.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for location features. Geocoding, reverse geocoding, and IP-to-location are commodity capabilities. This package removes the "build" option from the table: one Composer dependency wraps the mature geocoder-php/Geocoder library in a Laravel service provider, so the decision becomes "which provider do we pay for?" rather than "how many sprints to build geocoding?"
  • Feature scoping and roadmap. It is the enabler behind a recognizable backlog cluster: store/asset locators, address capture and normalization at checkout, delivery and ETA estimation, IP-based locale/currency/region routing, geo-personalized content, fraud and risk signals from IP, and map-pin placement via reverse lookup. If any of these sit in the next two quarters, this is infrastructure worth pre-investing in.
  • Vendor strategy and negotiation leverage. The Chain provider plus per-provider aliasing (->using('google_maps')) means the domain code never names a vendor. That is a negotiating asset: GoogleMaps, Nominatim, GeoPlugin, Mapbox, and others are swappable at the config layer, and a failing primary falls through to a secondary without an incident.
  • Unit-economics and reliability decisions. Caching is a first-class product lever here, not an afterthought: configurable duration (default is effectively forever), a recommended dedicated Redis store, per-locale cache keys so locale('it') and locale('fr') don't collide, and doNotCache() for query-level bypass. The adapter config (timeout, connectTimeout, retry) gives you knobs to trade latency against third-party flakiness without a release.
  • Security and compliance posture. The Laravel 13 note is a genuine product decision, not a footnote: the package auto-merges geocoder model classes into cache.serializable_classes to keep caching working under Laravel's new hardening default. The PM choice is explicit — accept the narrowly scoped relaxation, maintain your own allow-list, or disable geocoder caching. Related due diligence: confirm your chosen provider's terms permit storing results for the cache duration you configure (some providers restrict long-lived caching of geocoded output).
  • Localization and international launch. locale() support with isolated cache entries lowers the marginal cost of shipping in additional markets, which changes sequencing decisions for i18n roadmaps.

When to Consider This Package

Adopt when most of these are true:

  • The application is Laravel 11+ on PHP 8.2+ (13.x tracks Laravel 11/12/13 — note the deliberate version jump from 5.0.0).
  • You need address geocoding, reverse geocoding, and/or IP lookup as backend capabilities, not an interactive map UI.
  • You want provider flexibility and fallback without writing an abstraction layer yourself.
  • You expect repeat queries where caching meaningfully cuts API spend and latency.
  • You want testability — the default LaravelHttpClient delegates to Laravel's Http facade, so Http::fake() and Http::assertSent() work with zero setup, and existing retry/timeout/middleware config applies.
  • You are comfortable owning an MIT-licensed dependency: 754 stars and a reported zero dependents is thin social proof, so validate the maintainer bench and pin a version.

Look elsewhere, or supplement, when:

  • You need geospatial querying at scale — radius search, polygon containment, nearest-neighbor. That belongs in PostGIS, MySQL spatial indexes, or Elasticsearch, with this package only feeding coordinates in.
  • You need high-volume batch geocoding (millions of records). Rate limits, quotas, and job orchestration need a purpose-built pipeline, not per-request calls.
  • You need an interactive map experience — this is a server-side lookup layer; pair it with a front-end mapping library.
  • You require commercial SLA, indemnity, or vendor support — MIT gives you the code, not a help desk.
  • You are not on Laravel, or you have a single provider and trivial volume where a direct API call is less surface area.
  • Your security review demands full auditability of cache deserialization — workable here via opt-out, but factor in the effort.

How to Pitch It (Stakeholders)

For executives: This is a low-cost, low-risk shortcut to a set of location-dependent features — locators, address handling, IP-based regional routing — that would otherwise consume engineering sprints. It's MIT-licensed, installs as a single Composer package, and introduces no new vendor contract. The provider-abstraction layer is the strategic part: it keeps us from being locked into one geocoding vendor and gives us fallback if a provider degrades, while built-in caching directly controls the per-lookup API bill. Cost is engineering time plus whatever provider usage we choose; the package itself is free.

For engineering: Laravel-native integration — service provider, Geocoder facade, publishable config, DI-friendly aggregator. The default HTTP adapter routes through Laravel's Http facade, so Http::fake() works in tests out of the box and existing retry/timeout/middleware applies; any PSR-18 client can be swapped in. Providers compose via Chain for automatic fallback, and locale-aware caching keeps results correct across markets. Requirements are modern (PHP 8.2+, Laravel 11+), and releases track Laravel majors, so upgrade planning is predictable.

Risks to state plainly: thin adoption signal (754 stars, zero reported dependents) and a small maintainer pool — pin the version and budget for the possibility of forking. The Laravel 13 cache allow-list auto-registration is a deliberate, bounded relaxation of a security default; have someone review it and decide between auto-registration, a hand-managed allow-list, or doNotCache(). And confirm the chosen provider's terms permit the cache duration you set before committing to an "effectively forever" default.

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.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk