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

Technical Evaluation

Architecture fit. The package is a thin, conventional Laravel wrapper: a service provider binds a client, a facade (GoogleGeocoder) exposes it, and a published config file holds the API key. It fits the Laravel idioms of its era (5.x, PHP 5.6–7.1) and imposes little architectural opinion — which is simultaneously its appeal and its risk. Because it sits directly behind a facade, call sites tend to be statically coupled to the package's namespace and response objects. For any codebase we intend to own for more than a year, this is the wrong seam: we want an internal Geocoder contract (address in, normalized result out) with the package as one adapter behind it.

Integration feasibility. The blocker is dependency age, not API design. With a last release of 2017-09-27, expect illuminate/support constraints in the ~5.x range and a Guzzle constraint that collides with the Guzzle 7 that ships with Laravel 8+. On a modern PHP 8.1+/Laravel 10/11 estate, composer require will likely fail resolution outright; forcing it with platform-req overrides trades a clean install for runtime fatal errors on untyped, possibly deprecated signatures. On a legacy Laravel 5 app it will install and work. Practically: feasible as-is for legacy, requires a fork for current stacks, and the fork is small enough that "replace" usually beats "maintain."

Technical risk.

  • Abandonment (high). ~8 years without a release, 74 stars, no security-response path. It appears in SCA/audit tooling as an unmaintained dependency; we own all future CVEs.
  • Platform drift (high). No PHP 8 support statement, no Laravel package auto-discovery (extra.laravel), no PSR-18/PSR-17 abstraction. Each framework upgrade becomes a fork-and-patch exercise.
  • Provider drift (medium). Google has since made API keys mandatory, billing accounts mandatory, and HTTPS required; the surface of error codes (OVER_DAILY_LIMIT, REQUEST_DENIED) has expanded. The wrapper's error handling predates this and likely surfaces Google payloads raw.
  • Legal/compliance (medium). Google's terms restrict how geocoding results may be cached and stored — permanent storage is generally limited to lat/lng, not full result payloads. Any caching layer added around this package must be reviewed, and addresses are PII in most of our jurisdictions.
  • License (low). MIT is clean and permissive.

Key questions for the requestor.

  1. Which Laravel and PHP versions must this run on — legacy only, or current LTS?
  2. What is the monthly geocode volume and therefore the Google billing envelope? Who owns the API key and quota?
  3. Do we need forward geocoding only, or reverse geocoding, batch, and component filtering?
  4. Is multi-provider failover (Mapbox, HERE, self-hosted Nominatim) a foreseeable requirement?
  5. Can we accept Google's caching terms, or does a product requirement force us to persist full results?
  6. Who owns the fork if we take that path, and what is the budget for it?

Integration Approach

Stack fit. Clean fit for Laravel 5.1–5.5 on PHP 5.6–7.0. Poor fit for Laravel 8+ / PHP 8+. Treat "legacy app, low volume, short horizon" as the only green-light scenario for direct adoption.

Migration path. Three viable routes, in ascending order of preference:

  1. Adopt as-is — only inside a legacy app already on the compatible stack, with the package wrapped immediately in an internal interface.
  2. Fork and patch — bump Composer constraints, add package discovery, add PHP 8 signatures and return types, wrap Google's error payloads in typed exceptions. Estimated small effort but creates a permanent maintenance line item and a private package registry entry.
  3. Replace (recommended for greenfield or any modernization) — either geocoder-php/Geocoder with the Google Maps provider, or a ~200-line in-house client over Laravel's Http facade. The API is a single HTTPS GET with a key; the wrapper is not carrying meaningful complexity. Replacement removes the abandonment risk entirely for roughly the same effort as the fork.

Compatibility notes to verify during the spike. Confirm the exact illuminate/support and guzzlehttp/guzzle constraints in composer.json; confirm the config key name and facade alias so call-site grep is exhaustive; confirm whether the client returns raw arrays or value objects, since that dictates the shape of the internal contract.

Sequencing.

  1. Inventory all call sites by grepping the facade alias and namespace; count and classify them (forward, reverse, batch).
  2. Define an internal Geocoder interface with a normalized result and a typed exception set covering ZERO_RESULTS, REQUEST_DENIED, OVER_QUERY_LIMIT, and transport failure.
  3. Wrap the existing package in an adapter implementing that interface — a strangler-fig step, no behavior change, fully shippable on its own.
  4. Write contract tests against recorded Google responses so the adapter swap is provably behavior-preserving.
  5. Swap the adapter for the replacement client, delete the package, and remove the facade alias.
  6. Only then add caching, retries, and observability — layered at the interface, not inside the package.

For a legacy-only scenario, execute steps 1–3 and stop; that alone caps the blast radius.

Operational Impact

Maintenance. This is the dominant cost. There is no upstream to absorb framework or PHP upgrades, so every Laravel major becomes our work. Budget a named owner, a quarterly review of the fork against new Google API changes, and an explicit exit criterion. An unmaintained dependency also generates recurring noise in vulnerability scanning and procurement review; expect to justify it more than once.

Support. No vendor, no SLA, community-only issue tracker. Internal support means a runbook covering: how to rotate the API key, how to read Google's error payloads, what to do on quota exhaustion, and who to escalate to. The external support vector is the Google Geocoding API itself, whose deprecations and pricing changes arrive without warning and are the realistic source of incidents.

Scaling. The calls are synchronous HTTP with round-trip latency in the low hundreds of milliseconds. Google's standard limit is ~50 QPS, well above most product needs, but any bulk backfill must run through queued jobs with concurrency caps — do not geocode in a request cycle at volume. Cost scales linearly at roughly $5 per 1,000 requests against a monthly free allowance; a 100k/month workload is a real budget line, not a rounding error. A caching layer is the main lever but is bounded by Google's terms, so model the hit rate against realistic address-repeat rates before promising savings.

Failure modes to instrument.

  • REQUEST_DENIED — bad/rotated key or lapsed billing; fails closed and silently returns empty if the wrapper doesn't surface it.
  • OVER_QUERY_LIMIT / OVER_DAILY_LIMIT — needs backoff and an alert, not a retry storm.
  • ZERO_RESULTS — a valid outcome, not an error; conflating the two produces bad data quality and noisy pages.
  • UNKNOWN_ERROR — transient, retryable with jitter.
  • Transport timeouts and Guzzle version skew — the latter manifests as a hard boot failure after a framework upgrade, which is the most likely outage vector.
  • API key exposure in committed config — enforce env-var injection and key restriction by HTTP referrer/IP.

Ramp-up. Low for day-one productivity: a Laravel developer who knows facades can be shipping in an hour. The ramp-up risk is inverted — the package is easy enough that a team can adopt it without noticing it is eight years stale, and discover the constraint only at the next framework upgrade. Onboarding should include the abstraction boundary, the Google terms constraints on caching, and the cost model, not just the facade call.

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.
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
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle