Download the PHP package qdenka/sypexgeo without Composer
On this page you can find all versions of the php package qdenka/sypexgeo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sypexgeo
GeoIP for Laravel 7
The data comes from a database and from service http://sypexgeo.net
Installation
To get the latest version of SypexGeo simply require it in your composer.json
file.
"qdenka/sypexgeo": "^1.0"
You'll then need to 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/scriptixru/sypexgeo/scr/Scriptixru/SypexGeo) and extract it to/database/sypexgeo/
. And that's it.