sorbing/sypex-geo-laravel

The Sypex Geo PHP Class Wrapper for Laravel 4.2
66
Install
composer require sorbing/sypex-geo-laravel
PHP:>=5.4.0
License:MIT
Last Updated:Apr 3, 2015
Links: GitHub  ·  Packagist
Maintainer: Sorbing

The SypexGeo Laravel 4.x Package

Determine the City and Country info by IP address.

Installation

Require the package via composer:

composer require sorbing/sypex-geo-laravel

Or specify manually the package in require section in composer.json:

"sorbing/sypex-geo-laravel": "dev-master"

.. and run:

composer update

Register the Service Provider in providers array in app/config/app.php:

'Sorbing\SypexGeoLaravel\SypexGeoLaravelServiceProvider',

Use the following config in composer.json for install SxGeoCity.dat database:

"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

Usage the sypexgeo service from IoC:

/** @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;

Related Packages

adiesel82/sypex-geo-laravel-54

The Sypex Geo PHP Class Wrapper for Laravel 5.4

19 1
arnotae/frenchcities

Mysql table of french cities for Laravel 5

37 0
stevebauman/location

Retrieve a user's location by their IP Address

8,965,146 1,301
sirthxalot/laravel-circuit

Base radius calculation for postal codes.

2 0
yurtesen/geonames

Geonames importer and models for Eloquent ORM

1,675 31