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

Google Geocoder Laravel Package

alexpechkarev/google-geocoder

PHP client for the Google Maps Geocoding API. Convert addresses into latitude/longitude coordinates and reverse geocode coordinates back into addresses with a simple, framework-agnostic interface for adding location lookup to your apps.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping for anything location-shaped. This package covers the two primitive operations behind most geo features: address → lat/lng (geocoding) and lat/lng → address (reverse geocoding). That's the foundation for store/dealer locators, delivery zone assignment, "near me" search, map pin placement, and address capture at checkout. It does not cover autocomplete/Places, directions, distance matrices, or bulk geocoding — scope those as separate bets.
  • Build vs. buy for the integration layer. The real decision this forces is not "Google or not" — you've likely already chosen Google Maps Platform — but "do we take a dependency for a ~200-line HTTP wrapper?" This package is a thin Guzzle client plus a Laravel service provider and facade. A PM should frame the choice as adopt a stale wrapper vs. write a small internal adapter vs. use willdurand/geocoder with the Google Maps provider, and weigh maintenance cost, not feature parity.
  • Geocode-at-write vs. geocode-at-read. Whether you resolve coordinates when an address is saved (denormalized, cheap to read, stale when addresses change) or on each request (fresh, but per-call cost and latency). This affects data model, cost model, and SLA — a decision worth making explicitly rather than by default.
  • Cost modeling and quota policy. Every geocode is a billable Google Maps Platform call. The decision to cache, debounce, batch, or pre-compute flows directly from projected volume and the current free tier. Confirm today's pricing and free-call allowance; do not rely on the 2017-era assumptions this package was written under.
  • Data retention and compliance posture. Google's Maps Platform terms constrain storing and redisplaying geocoding results (generally: display on a Google map, limited temporary caching, but persistent storage of Place IDs is permitted). That's a product-visible constraint — it decides whether you store place_id plus a short-lived coordinate cache instead of permanently persisting lat/lng. Getting this wrong is a licensing problem, not a bug.
  • International coverage and address-quality expectations. Google's geocoder quality varies sharply by country and by address specificity. This informs whether you promise rooftop accuracy or fall back to city/postcode centroid, and whether you need a fallback provider for weak regions.

When to Consider This Package

Reasonable to evaluate when:

  • You're on a legacy Laravel 5.x / PHP 7.x app and want a geocoder wired into the container and facade system in an afternoon.
  • The need is small, bounded, and internal — an admin tool, a one-off data enrichment script, a proof of concept to validate a locator feature before committing budget.
  • You already have Google Maps Platform billing, API key management, and quotas in place; the package is only the transport.
  • You accept that you may fork it. At 74 stars and a last release in September 2017, treat it as sample code you adopt, not a maintained dependency.

Look elsewhere when:

  • You're on Laravel 9/10/11 or PHP 8.x. Service provider registration, discovery, and Guzzle version constraints from a 2017 package are likely to fight your framework, and there will be no upstream fix.
  • You need security patch cadence, a supported dependency in your SBOM, or a vendor to escalate to. An unmaintained package is a standing risk-register entry.
  • You need provider abstraction or failover (Google primary, Mapbox/HERE/Nominatim fallback). A single-provider wrapper gives you no seam for that.
  • You need Places Autocomplete, Directions, Distance Matrix, or bulk/batch geocoding of a large dataset — different APIs, different quota math, often different providers entirely.
  • You need testable, mockable seams. Verify whether the wrapper lets you inject an HTTP client; if not, you'll be hitting the live API in tests or writing your own adapter anyway.
  • Cost sensitivity is high and volume is significant — at that point the architecture question (cache strategy, Place ID storage, batch providers) dominates and the wrapper is irrelevant.

How to Pitch It (Stakeholders)

To executives: This is a cheap experiment, not a platform decision. It lets us validate a location feature in days at negligible engineering cost and near-zero infrastructure spend, using a vendor we'd likely pick anyway. The caveat is maintenance: the package hasn't been updated since 2017, so it's a prototype accelerant — if the feature proves out, we budget roughly a day of engineering to replace it with a small internal adapter we own. Frame the ask as a time-boxed spike with a defined exit, not an adoption.

To engineering: It's a Guzzle wrapper around the Google Geocoding API with a service provider and facade — no novel logic, no reason to inherit its age. Recommendation: use it only if we're on Laravel 5.x, and only behind an interface we define (Geocoder::geocode(), Geocoder::reverse()) so swapping to a first-party adapter or geocoder-php is a one-file change. Do not let controllers call the facade directly. Treat the Google terms on caching and redisplay as a hard requirement in the design review — persist Place IDs, cache coordinates short-term, render on a Google map.

Bottom line: adopt only as a disposable prototype dependency; production warrants either a fork we control or ~200 lines of our own code behind an interface, plus an explicit decision on caching, retention, and per-call cost.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib