Download the PHP package stolkom/sypexgeo without Composer
On this page you can find all versions of the php package stolkom/sypexgeo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sypexgeo
GeoIP for Laravel 5
The data comes from a database and from service http://sypexgeo.net
Installation
To get the latest version of stolkom/sypexgeo use the command:
composer require stolkom/sypexgeo
Or require it in your composer.json
file.
"stolkom/sypexgeo": "^1.0"
And than run composer install
to download it and have the autoloader updated.
Once GeoIP is installed you need to register the service provider with the application. Open up config/app.php
and find the providers
key.
'providers' => array(
'Scriptixru\SypexGeo\SypexGeoServiceProvider',
)
GeoIP also ships with a facade which provides the static syntax for creating collections. You can register the facade in the aliases
key of your config/app.php
file.
'aliases' => array(
'SypexGeo' => 'Scriptixru\SypexGeo\SypexGeoFacade',
)
Publish the configurations
Run this on the command line from the root of your project:
$ php artisan vendor:publish
A configuration file will be publish to config/sypexgeo.php
Usage
Getting the location data for a given IP:
Example Data
If data is received from the database - config/sypexgeo.php ('type' => 'database')
If data is received from the webservice - config/sypexgeo.php ( 'type' => 'web_service', 'view' => 'json' )
Default Location
In the case that a location is not found the fallback location will be returned with the default
parameter set to true
. To set your own default change it in the configurations config/geoip.php
Services
Scriptix
- Database Service: To use the database version of SypexGeo services download the
SxGeoCityMax.dat
from (vendor/stolkom/sypexgeo/scr/Scriptixru/SypexGeo) and extract it to/database/sypexgeo/
. And that's it.