eseath/sypexgeo
Larablocks Analysis
eseath/sypexgeo works with any PHP project: the latest release (v2.3.2, Feb 10, 2024) doesn't depend on Laravel.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- No release in the last 12 months (last: Feb 10, 2024)
- 6,906 downloads a month (needs 10,000)
- 11 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Feb 10, 2024.
- No releases in the last 12 months.
- First released: Feb 1, 2017.
- Monthly downloads: 6,906, up 26% from six months ago.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.
| Install | |
|---|---|
composer require eseath/sypexgeo |
|
| Latest Version: | v2.3.2 |
| PHP: | ^7.0|^8.0 |
| License: | MIT |
| Last Updated: | Feb 10, 2024 |
| Links: | GitHub · Packagist |
SypexGeo PHP API
A PHP package for working with the SypexGeo database file.
The current version supports Laravel 5.1 and later.
Installation
composer require eseath/sypexgeo
For non-Laravel projects, you need to manually download the database file:
The database is updated 2 times a month.
Setup
Laravel
1. If Laravel version <= 5.4, add into config/app.php:
'providers' => [
\Eseath\SxGeo\SxGeoServiceProvider::class,
]
2. Publish config sxgeo.php (optionally):
php artisan vendor:publish --provider="Eseath\SxGeo\SxGeoServiceProvider"
By default, in config specified URL to the database of cities. If you want the database of countries, change url:
...
'dbFileURL' => 'https://sypexgeo.net/files/SxGeoCountry.zip',
...
3. Download the database file:
php artisan sxgeo:update
You can use this command to upgrade database to the current version via CRON.
Usage
use Eseath\SxGeo\SxGeo;
$sxGeo = new SxGeo('/path/to/database/file.dat');
$fullInfo = $sxGeo->getCityFull($ip);
$briefInfo = $sxGeo->get($ip);
With Laravel
use SxGeo;
$data = SxGeo::getCityFull($ip);
Example Data
array:3 [▼
"city" => array:5 [▼
"id" => 524901
"lat" => 55.75222
"lon" => 37.61556
"name_ru" => "Москва"
"name_en" => "Moscow"
]
"region" => array:4 [▼
"id" => 524894
"name_ru" => "Москва"
"name_en" => "Moskva"
"iso" => "RU-MOW"
]
"country" => array:6 [▼
"id" => 185
"iso" => "RU"
"lat" => 60
"lon" => 100
"name_ru" => "Россия"
"name_en" => "Russia"
]
]
array:2 [▼
"city" => array:5 [▼
"id" => 524901
"lat" => 55.75222
"lon" => 37.61556
"name_ru" => "Москва"
"name_en" => "Moscow"
]
"country" => array:2 [▼
"id" => 185
"iso" => "RU"
]
]
Running Tests
The tests are run automatically by Travis CI on multiple PHP and Laravel versions.
If you want to run tests locally, use the following command:
python3 ./test.py
Development
docker-compose run php-7.1 composer install
Related Packages
A PHP library that knows how any country, state or city is called in any languag...
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v2.3.2 | ^7.0| | MIT | |
| v2.3.1 | ^7.0| | MIT | |
| v2.3.0 | ^7.0| | MIT | |
| v2.2.0 | ^7.0| | MIT | |
| v2.1.0 | ^7.0| | MIT | |
| v2.0.4 | ^7.0 | MIT | |
| v2.0.3 | ^7.0 | MIT | |
| v2.0.2 | ^7.0 | MIT | |
| v2.0.1 | ^7.0 | MIT | |
| v2.0.0 | ^7.0 | MIT | |
| 1.1.0 | >=5.6.4 | MIT | |
| v1.0.0 | >=5.6.4 | MIT |