1.0.4
1.0.4.0Geolocation services for Laravel 5.x
MIT
The Requires
- php >=5.6
- guzzlehttp/guzzle ^6.3
by JB
dev-master
9999999-devGeolocation services for Laravel 5.x
MIT
The Requires
- php >=5.6
- guzzlehttp/guzzle ^6.3
by JB
Wallogit.com
2017 © Pedro Peláez
Geolocation services for Laravel 5.x
This package provides geolocation information including country, city, latitude and longitude based on request IP. There are a few available providers: Extreme IP Lookup, Free GeoIP, Geobytes and Geoplugin., (*1)
Install the package using composer:, (*2)
composer require itech-ro/geolocation
Edit app/config.php and add this line to providers array:, (*3)
'providers' => [
...
Roitech\Geolocation\GeolocationServiceProvider::class,
...
];
Create a configuration file config/geolocation.php with the content:, (*4)
<?php
return [
'provider' => 'geoplugin',
];
Once you set the preferred provider in config/geolocation.php (possible values: geobytes, freegeoip, extremeiplookup, geoplugin) the geolocation details can be accessed using the Geolocation facade:, (*5)
$coordinates = Geolocation::getCoordinates(); //returns an array [ 'lat' => LATITUDE, 'long' => LONGITUDE ] $city = Geolocation::getCity(); $country = Geolocation::getCountry();
Geolocation services for Laravel 5.x
MIT
Geolocation services for Laravel 5.x
MIT