taldres/laravel-geocode-cache
A lightweight Laravel package for caching geocoding results, letting you store and reuse address lookups via your chosen cache driver to cut repeated API calls, improve response times, and keep third-party usage under control. Configurable and easy to drop into any Laravel app.
Architecture fit — laravel-geocode-cache is a Laravel package that wraps Google Geocoding lookups behind a cache layer. Architecturally it slots in as an infrastructure concern: a service provider, config file, and (assumed) facade/binding that domain code calls instead of hitting Google directly. For a TPM this is attractive because it isolates two things we would otherwise re-implement in every service: provider coupling and cache policy. The v0.2.0 change is a policy change, not a functional one — it caps cached-result retention at 29 days, which is clearly driven by Google Maps Platform terms (results may not be cached beyond ~30 days). That is the single most important fact in this release: the package now enforces a compliance constraint we would otherwise have to police ourselves.
Integration feasibility — Low effort, standard Laravel package install: composer require, publish config, supply an API key, select a cache store. No schema changes implied (unless the database cache driver is used). Integration is likely a day or less of engineering plus compliance review. The real work is not wiring it up; it is deciding what our own persistence layer is allowed to do (see risks).
Technical risk — Several, in descending order:
0.x, breaking changes ship on minor bumps — which is exactly what v0.2.0 is (fix!:). We must pin exact versions and treat every upgrade as potentially breaking. Do not float ^0.2.Key questions
file a second-class citizen)?ZERO_RESULTS handled — exceptions, nulls, or cached negatives? Are negative results also capped at 29 days?Stack fit — Assumed Laravel 9–11 / PHP 8.x; verify composer.json constraints before committing. Fits any Laravel service that resolves addresses to coordinates or vice versa: store locators, delivery/zone assignment, address validation, geo-enrichment pipelines. It does not fit high-volume batch geocoding (Google's terms restrict bulk caching and the package is a per-lookup cache), nor does it fit use cases needing a durable, authoritative coordinate store.
Migration path — There is no prior assessment to diff against, so treat this as a greenfield adoption with a mandatory upgrade note for anyone already on v0.1.0:
0.2.0 exactly in composer.json.geocoded_at timestamp or a re-resolve-on-staleness branch.Compatibility — Confirm the cache store we intend to use is on the tested list; Redis is the safe default and gives us tagging, TTL visibility, and flush-by-namespace. If we run multi-tenant or multi-region, confirm key prefixing so one tenant's flush does not nuke another's. Check that a cache driver change (e.g., file → Redis) does not change TTL semantics.
Sequencing
Maintenance — Low code churn, but non-zero upgrade risk because of the 0.x versioning. Budget a recurring line item: review each release, read the diff (release notes alone are insufficient — this one conveys the what but not the how), and re-validate TTL behavior. Realistically a few hours per release. The release-notes automation is bot-generated and terse; do not let it substitute for reading PR #10.
Support — No commercial support. Community issues only, single maintainer, best-effort. We need a named internal owner and an exit plan: the wrapper is thin enough that forking or reimplementing (~200–400 LOC) is a credible fallback. Do not let this become a single point of organizational knowledge.
Scaling — Two coupled ceilings: our cache capacity and Google's quota. The 29-day cap increases steady-state refresh rate versus an indefinite cache — model it. If we hold N distinct addresses, expect roughly N/29d of fresh API calls per day at steady state, plus miss-driven traffic. Size the cache store accordingly and set quota alerts at ~70% of the Google daily limit. Plan for concurrency control on popular keys so a simultaneous expiry does not produce a miss storm (jittered TTLs or a lock are the usual fixes — confirm whether the package provides either).
Failure modes
null coordinates corrupting downstream logic. Silently returning null is the more dangerous of the two; verify.Ramp-up — For a mid-level Laravel engineer: half a day to integrate and test, comfortably. The harder ramp is organizational: compliance, legal, and on-call need to understand that the 29-day limit is a terms-of-service obligation, not a tuning parameter, and that bypassing it by persisting results elsewhere is a policy violation rather than an optimization. Include that framing in the runbook, not just the code comments.
How can I help you explore Laravel packages today?