Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/latrell/geohash
Geohash package for Laravel4.
https://github.com/latrell/geohash
Last synced: 5 days ago
JSON representation
Geohash package for Laravel4.
- Host: GitHub
- URL: https://github.com/latrell/geohash
- Owner: latrell
- Created: 2014-12-06T08:38:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-27T06:56:44.000Z (over 9 years ago)
- Last Synced: 2024-10-23T16:38:34.789Z (21 days ago)
- Language: PHP
- Size: 155 KB
- Stars: 11
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Geohash
======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.
```php
'providers' => [
// ...
'Latrell\Geohash\GeohashServiceProvider',
]
```Find the aliases key in `config/app.php`.
```php
'aliases' => [
// ...
'Geohash' => 'Latrell\Geohash\Facades\Geohash',
]
```## Usage
Encode a coordinate:
```php
echo Geohash::encode(31.283131, 121.500831); // wtw3uyfjqw61
```Decode a Geohash:
```php
list($lat, $lng) = Geohash::decode('wtw3uyfjqw61');
echo $lat, ', ', $lng; // 31.283131, 121.500831
```