dev-master
9999999-devThe Sypex Geo PHP Class Wrapper for Laravel 4.2
MIT
The Requires
- php >=5.4.0
- igi/sypexgeo dev-master
- illuminate/support 4.2.*
by Stanislav Butsenko
laravel geo ip city sypex
The Sypex Geo PHP Class Wrapper for Laravel 4.2
Determine the City and Country info by IP address., (*1)
Require the package via composer:, (*2)
composer require sorbing/sypex-geo-laravel
Or specify manually the package in require
section in composer.json
:, (*3)
"sorbing/sypex-geo-laravel": "dev-master"
.. and run:, (*4)
composer update
Register the Service Provider in providers
array in app/config/app.php
:, (*5)
'Sorbing\SypexGeoLaravel\SypexGeoLaravelServiceProvider',
Use the following config in composer.json
for install SxGeoCity.dat
database:, (*6)
"scripts": { "post-update-cmd": [ "IgI\\SypexGeo\\Composer::installDatabases" ] }, "extra": { "sypexgeo_remote": "https://sypexgeo.net/files/SxGeoCity_utf8.zip", "sypexgeo_local": "app/database/SxGeoCity.dat" }
Usage the sypexgeo
service from IoC:, (*7)
/** @var \Sorbing\SypexGeoLaravel\SypexGeoService $sypexGeo */ $sypexGeo = \App::make('sypexgeo'); /** @var \Sorbing\SypexGeoLaravel\Wrappers\GeoDataWrapper $geoData */ $geoData = $sypexGeo->get('1.2.3.4'); echo $geoData->city->nameRu;
The Sypex Geo PHP Class Wrapper for Laravel 4.2
MIT
laravel geo ip city sypex