2017 © Pedro Peláez
 

library sypex-geo-laravel

The Sypex Geo PHP Class Wrapper for Laravel 4.2

image

sorbing/sypex-geo-laravel

The Sypex Geo PHP Class Wrapper for Laravel 4.2

  • Friday, April 3, 2015
  • by Sorbing
  • Repository
  • 1 Watchers
  • 0 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

The SypexGeo Laravel 4.x Package

Determine the City and Country info by IP address., (*1)

Installation

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

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 Versions

03/04 2015

dev-master

9999999-dev

The Sypex Geo PHP Class Wrapper for Laravel 4.2

  Sources   Download

MIT

The Requires

 

by Stanislav Butsenko

laravel geo ip city sypex