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 Maps Provider

Google Maps Provider Laravel Package

geocoder-php/google-maps-provider

Google Maps provider for the PHP Geocoder library. Adds geocoding and reverse geocoding via Google’s APIs, supporting address and coordinate lookups with configurable options and authentication. Suitable for Laravel and other PHP apps.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Provider for Google maps

Frequently asked questions about Google Maps Provider
How do I install the Google Maps provider for Geocoder in Laravel?
Run `composer require geocoder-php/google-maps-provider` and register the provider in `config/app.php` under `providers`. Then bind the GoogleMapsProvider to Laravel’s container in a service provider or use a facade for cleaner syntax.
What Laravel versions does this package support?
The package supports Laravel 8.x, 9.x, and 10.x. Ensure your `composer.json` pins compatible versions of `geocoder-php/Geocoder` and `google-maps-provider` to avoid conflicts.
Can I use this for reverse geocoding (coordinates to addresses) in Laravel?
Yes. Inject the GoogleMapsProvider into a service class or use a facade like `Geocoder::reverse($latitude, $longitude)` to fetch addresses from coordinates. Cache results to optimize performance.
How do I handle Google Maps API rate limits in production?
Implement caching (Redis/Memcached) with TTLs, use Laravel queues for async requests, and enable exponential backoff in your provider configuration. Monitor usage via Google Cloud Console.
Is it possible to fallback to another provider if Google Maps fails?
Yes. The Geocoder library supports multiple providers. Configure a fallback chain in your service provider (e.g., GoogleMaps → OpenStreetMap) using `Geocoder::create()` with multiple providers.
How do I securely store Google API keys in Laravel?
Store keys in environment variables (`.env`) or use Laravel Vault for sensitive data. Scope keys per environment (e.g., `GOOGLE_MAPS_KEY_PROD`, `GOOGLE_MAPS_KEY_TEST`) and restrict usage via Google Cloud API restrictions.
Can I batch geocode addresses in Laravel using this package?
Yes. Use Laravel queues to process batches asynchronously. Create a job (e.g., `GeocodeBatchJob`) that iterates over addresses and calls `Geocoder::geocode()` for each, then store results in a database.
How do I test geocoding accuracy in Laravel?
Mock API responses in PHPUnit tests using `Http::fake()` to simulate successful/failure scenarios. Validate results against known addresses (e.g., assert latitude/longitude fall within a 50m radius).
Will this work with Laravel Scout for geospatial search?
Yes. Store geocoded coordinates (latitude/longitude) in your model and use Scout’s full-text search with geospatial extensions (e.g., Algolia’s geosearch) or Laravel’s native `DB::raw` queries for distance-based filtering.
Are there alternatives to Google Maps for geocoding in Laravel?
Yes. Consider OpenStreetMap (free, via `geocoder-php/OpenStreetMapProvider`), Mapbox, or Here Maps. Each has trade-offs in accuracy, cost, and API limits. Test alternatives in staging before switching.
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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style