承接 blazeffect/laravel-sypexgeo 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blazeffect/laravel-sypexgeo

最新稳定版本:1.0.0

Composer 安装命令:

composer require blazeffect/laravel-sypexgeo

包简介

Supports GeoIP services (sypexgeo.net).

README 文档

README

The data comes from a database

Installation

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

"blazeffect/laravel-sypexgeo": "1.0.0"

You'll then need to run composer install to download it and have the autoloader updated.

The package will automatically register a service provider.

Publish the configurations

Run this on the command line from the root of your project:

$ php artisan vendor:publish --tag=sxgeo-config

A configuration file will be publish to config/sxgeo.php

Usage

Getting the location data for a given IP:

$sxgeo = app('sxgeo');
$location = $sxgeo->get('232.223.11.11');

Example Data

If data is received from the database - config/sxgeo.php

        [
            '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',
            ],
        ];

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

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-09-19