PHPackages                             stolkom/sypexgeo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stolkom/sypexgeo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stolkom/sypexgeo
================

Supports GeoIP services (sypexgeo.net).

v1.0.0(4y ago)055BSD-2-ClausePHPPHP &gt;=5.4.0

Since Feb 3Pushed 4y agoCompare

[ Source](https://github.com/stolkom/sypexgeo)[ Packagist](https://packagist.org/packages/stolkom/sypexgeo)[ RSS](/packages/stolkom-sypexgeo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

GeoIP for Laravel 5
===================

[](#geoip-for-laravel-5)

---

The data comes from a database and from service

Installation
------------

[](#installation)

- [SypexGeo for Laravel 5 on Packagist](https://packagist.org/packages/stolkom/sypexgeo)
- [SypexGeo for Laravel 5 on GitHub](https://github.com/stolkom/sypexgeo)

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

[](#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
-----

[](#usage)

Getting the location data for a given IP:

```
$location = \SypexGeo::get('232.223.11.11');
```

### Example Data

[](#example-data)

If data is received from the database - config/sypexgeo.php ('type' =&gt; 'database')

```
        [
            'city' => [
                'id' => 524901,
                'lat' => 55.75222,
                'lon' => 37.61556,
                'name_ru' => 'Москва',
                'name_en' => 'Moscow',
                'okato' => '45',
            ],
            'region' => [
                'id' => 524894,
                'lat' => 55.76,
                'lon' => 37.61,
                'name_ru' => 'Москва',
                'name_en' => 'Moskva',
                'iso' => 'RU-MOW',
                'timezone' => 'Europe/Moscow',
                'okato' => '45',
            ],
            'country' => [
                'id' => 185,
                'iso' => 'RU',
                'continent' => 'EU',
                'lat' => 60,
                'lon' => 100,
                'name_ru' => 'Россия',
                'name_en' => 'Russia',
                'timezone' => 'Europe/Moscow',
            ],
        ];
```

If data is received from the webservice - config/sypexgeo.php ( 'type' =&gt; 'web\_service', 'view' =&gt; 'json' )

```
        [
              "ip" => "77.37.136.11"
              "city" => array:8 [
                     "id" => 524901
                     "lat" => 55.75222
                     "lon" => 37.61556
                     "name_ru" => "Москва"
                     "name_en" => "Moscow"
                     "okato" => "45"
                     "vk" => 1
                     "population" => 10381222
                  ]
              "region" => array:11 [
                    "id" => 524894
                    "lat" => 55.76
                    "lon" => 37.61
                    "name_ru" => "Москва"
                    "name_en" => "Moskva"
                    "iso" => "RU-MOW"
                    "timezone" => "Europe/Moscow"
                    "okato" => "45"
                    "auto" => "77, 97, 99, 177, 197, 199, 777"
                    "vk" => 0
                    "utc" => 3
              ]
              "country" => array:18 [
                    "id" => 185
                    "iso" => "RU"
                    "continent" => "EU"
                    "lat" => 60
                    "lon" => 100
                    "name_ru" => "Россия"
                    "name_en" => "Russia"
                    "timezone" => "Europe/Moscow"
                    "area" => 17100000
                    "population" => 140702000
                    "capital_id" => 524901
                    "capital_ru" => "Москва"
                    "capital_en" => "Moscow"
                    "cur_code" => "RUB"
                    "phone" => "7"
                    "neighbours" => "GE,CN,BY,UA,KZ,LV,PL,EE,LT,FI,MN,NO,AZ,KP"
                    "vk" => 1
                    "utc" => 3
              ]
              "error" => ""
              "request" => -2
              "created" => "2015.04.08"
              "timestamp" => 1428516249
        ];
```

#### Default Location

[](#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
--------

[](#services)

### [Scriptix](http://www.scriptix.ru)

[](#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.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1556d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5691293b76418218ff1b36ecad492d14398a224da6d9b686118b20d15db5026e?d=identicon)[stolkom](/maintainers/stolkom)

---

Top Contributors

[![scriptixru](https://avatars.githubusercontent.com/u/11806645?v=4)](https://github.com/scriptixru "scriptixru (10 commits)")[![stolkom](https://avatars.githubusercontent.com/u/86167115?v=4)](https://github.com/stolkom "stolkom (8 commits)")

---

Tags

laravelgeoipgeolocationlaravel 5location

### Embed Badge

![Health badge](/badges/stolkom-sypexgeo/health.svg)

```
[![Health](https://phpackages.com/badges/stolkom-sypexgeo/health.svg)](https://phpackages.com/packages/stolkom-sypexgeo)
```

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[midnite81/geolocation

A laravel package which wraps the IP Info DB and IP2Location Services

3624.1k](/packages/midnite81-geolocation)[tabgeo/country

geoip (only countries) php library (http://tabgeo.com)

1158.8k](/packages/tabgeo-country)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
