Weave Code
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky