PHPackages                             atreslesne/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. atreslesne/sypexgeo

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

atreslesne/sypexgeo
===================

Supports GeoIP services (sypexgeo.net).

1261PHP

Since May 16Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)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/scriptixru/sypexgeo)
- [SypexGeo for Laravel 5 on GitHub](https://github.com/scriptixru/sypexgeo)

To get the latest version of SypexGeo simply require it in your `composer.json` file.

```
"scriptixru/sypexgeo": "0.2.*@dev"

```

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

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

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/574770950137c4e5f4d72a5acb9756c1f65fa77127ce1f226a3cfafa4d174aea?d=identicon)[atreslesne](/maintainers/atreslesne)

---

Top Contributors

[![scriptixru](https://avatars.githubusercontent.com/u/11806645?v=4)](https://github.com/scriptixru "scriptixru (10 commits)")[![atreslesne](https://avatars.githubusercontent.com/u/2431783?v=4)](https://github.com/atreslesne "atreslesne (1 commits)")

### Embed Badge

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

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

###  Alternatives

[jyxon/gdpr-cookie-compliance

A library to comply with the GDPR law.

5848.5k](/packages/jyxon-gdpr-cookie-compliance)[umpirsky/composer-permissions-handler

Composer script handling directories permissions by making them writable both by the web server and the command line user.

6630.3k](/packages/umpirsky-composer-permissions-handler)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[dktapps/pmforms

Form API library for PocketMine-MP plugins

522.3k1](/packages/dktapps-pmforms)[hexadog/laravel-menus-manager

Dynamic Menus Management package for your Laravel application

184.5k](/packages/hexadog-laravel-menus-manager)[melios/page-builder

Improvements for the built-in Magento PageBuilder module

131.4k](/packages/melios-page-builder)

PHPackages © 2026

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