| Package Data | |
|---|---|
| Maintainer Username: | rtablada |
| Maintainer Contact: | ryan.tablada@gmail.com (Ryan Tablada) |
| Package Create Date: | 2013-06-17 |
| Package Last Update: | 2013-07-01 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-28 03:03:01 |
| Package Statistics | |
|---|---|
| Total Downloads: | 156 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 4 |
| Total Watchers: | 2 |
| Total Forks: | 2 |
| Total Open Issues: | 1 |
This is a simple geocode provider for PHP. By default, it uses google's geocode API but any compatible API will work.
This package can be installed using composer using composer require rtablada/geocoder.
For Laravel 4, this package and its Service Provider can be installed using php artisan package:install rtablada/geocoder.
On both, specify dev-master as the version constraint.
To use this package outside of Laravel you can use
require 'vendor/autoload.php';
$geocoder = new Rtablada\Geocoder\Geocoder;
var_dump($geocoder->getLocationFromQuery('Atlanta'));
The geocoder provides the following functions
The Geocoder Package also provides two helper classes (Location and Coordinate).
The Coordinate is a simple object with lat and lng properties.
The Location object has address and coordinates properties. The coordinates is an instance of the Coordinate class.
The Location class also provides a newInstanceFromObject method to parse Google Geocode Result objects into Location objects.