plutuss / here-coding-geo
A Laravel package for working with HERE Maps geolocation services, including geocoding, reverse geocoding, and route calculations.
Requires
- php: ^8.0|^8.1|^8.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-20 20:13:49 UTC
README
Use HERE Geocoding and Search API v7 from a Laravel application running PHP 8.0 or later.
Installation
composer require plutuss/here-coding-geo
Get a HERE API key and set it in your Laravel application's .env file. HERE API key instructions
HERE_API_KEY=your-api-key
The package loads its default configuration automatically. To customize it, publish the configuration file and edit config/here-platform.php.
php artisan vendor:publish --provider="Plutuss\HerePlatform\Providers\GeoCodingServiceProvider"
Usage
use Plutuss\HerePlatform\Facades\GeoCoding; $addresses = GeoCoding::geocodeSearch('Berlin', 'Invalidenstraße', '116'); $nearbyAddresses = GeoCoding::reverse(52.53086, 13.38469, 50); $places = GeoCoding::discover(52.53086, 13.38469, 'coffee'); $suggestions = GeoCoding::autocomplete('Berlin Invaliden', 5); foreach ($addresses as $address) { $title = $address->title(); $postalCode = $address->addressPostalCode(); $latitude = $address->getNestedValue('position.lat'); }
reverse() searches within a radius in meters. The default is 10 meters, and fractional values round up to the next whole meter. autocomplete() takes an optional result limit that defaults to the configured value of 20.
Each method returns an array of GeoCodingResponse objects. A successful search with zero matches returns []. Optional fields can be null. House numbers and postal codes are nullable strings, preserving letters and leading zeros.
For unsuccessful HTTP responses, the client throws a Symfony HttpException with the upstream status. A 200 response with an invalid results payload throws an HttpException with status 502.