Set GOOGLE_PLACES_CACHE=true to cache idempotent lookups (details, geocode, forward geocode, distance, distance matrix, text & nearby search). Autocomplete is never cached. Cache keys never contain the API key:
GOOGLE_PLACES_CACHE=true
GOOGLE_PLACES_CACHE_STORE=redis # optional; null = the default store
GOOGLE_PLACES_CACHE_TTL=86400 # seconds- Cached: details(), geocode(), geocodeAddress(), textSearch(), nearbySearch(), findPlace() (it runs a text search), distance(), computeMatrix() and matrix().
- Not cached: autocomplete(), the paginated helpers textSearchPaginated() / nearbySearchPaginated(), photo requests (photo(), photoUri(), photoContents()) and check().
- A details 404 is an answer — “no such place” — and is cached like any other result, so repeats are not re-billed.
- Transient failures always throw and are never cached.
- The package caches Google’s raw payload and rebuilds the DTOs on read, so entries work with Laravel’s cache.serializable_classes restriction.
- Cache hits make no request, so they dispatch no lifecycle event.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.