Download the PHP package sysborg/gmaps-laravel without Composer
On this page you can find all versions of the php package sysborg/gmaps-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gmaps-laravel
sysborg/gmaps-laravel
A Google Maps API package for Laravel built on Ports and Adapters (Hexagonal Architecture) — clean, testable, and designed to grow with your needs.
Why this package?
Most Google Maps packages for Laravel expose raw arrays and mix API calls directly into your business logic. This package takes a different approach:
- Ports and Adapters — your domain code never talks to Google directly; it depends on interfaces
- Typed DTOs —
readonlyclasses with full IDE autocomplete, no more guessing array keys - Built-in cache strategy — configurable TTL per use case to save money on API calls
- Facade + DI — use whichever style fits your team
Installation
Publish the config:
Add your API key to .env:
Make sure the Places API is enabled in your Google Cloud Console.
Usage
Nearby Places Search
Find all locations within a radius from a geographic point.
Via Facade:
Via Dependency Injection:
Cache Strategy
Every API call is cached by default. The cache key is a deterministic hash of all request parameters — same input always hits the cache.
Full config reference at config/gmaps.php.
Architecture
Testing
All tests use Http::fake() — no real API calls are made.
Currently Implemented
| Feature | Status |
|---|---|
| Places — Nearby Search | ✅ |
| Cache with TTL per use case | ✅ |
| Facade + DI integration | ✅ |
| Typed DTOs (readonly) | ✅ |
| PHPUnit tests with Http::fake() | ✅ |
Roadmap — Have a need? Open an issue!
This package is built to grow. The architecture makes it straightforward to add new APIs without touching existing code. If you need any of the below — or something not listed — open an issue and describe your use case. Contributions are welcome.
| Feature | Notes |
|---|---|
| Places — Text Search | Search by keyword anywhere |
| Places — Place Details | Full details by place_id |
| Places — Autocomplete | For address/search inputs |
| Geocoding API | Address ↔ coordinates |
| Reverse Geocoding | Coordinates → formatted address |
| Directions API | Routes with waypoints |
| Distance Matrix | Multi-origin/destination travel time |
| Static Maps | Generate map image URLs |
| Elevation API | Altitude for coordinates |
| Time Zone API | Timezone from coordinates |
| Roads API | Snap-to-road, speed limits |
| Pagination helper | Auto-fetch next pages |
| Multi-page collector | Merge all paginated results automatically |
Have a specific need? Open an issue describing what you need and how you plan to use it. The more context you give, the faster it gets implemented.
Contributing
- Fork the repository
- Create a branch:
git checkout -b feat/your-feature - Follow the existing patterns — one port, one adapter, one use case (see
docs/plan/architecture.md) - Write tests with
Http::fake() - Open a PR
Support the project
If this package saves you time or reduces your Google Maps API costs, consider buying a coffee. It helps keep this maintained and motivates new features to be added.
License
MIT © Anderson Arruda
All versions of gmaps-laravel with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0