latrell / geohash
This package geohash for Laravel 5 support.
Installs: 27 998
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 1
Forks: 6
pkg:composer/latrell/geohash
Requires
- php: >=5.4.0
- illuminate/support: 5.*
This package is not auto-updated.
Last update: 2025-10-21 08:38:08 UTC
README
This package geohash for Laravel 5 support.
Installation
composer require latrell/geohash dev-master
Update your packages with composer update
or install with composer install
.
Find the providers
key in config/app.php
and register the Geohash Service Provider.
'providers' => [ // ... 'Latrell\Geohash\GeohashServiceProvider', ]
Find the aliases key in config/app.php
.
'aliases' => [ // ... 'Geohash' => 'Latrell\Geohash\Facades\Geohash', ]
Usage
Encode a coordinate:
echo Geohash::encode(31.283131, 121.500831); // wtw3uyfjqw61
Decode a Geohash:
list($lat, $lng) = Geohash::decode('wtw3uyfjqw61'); echo $lat, ', ', $lng; // 31.283131, 121.500831