承接 psonrie/geolocation 相关项目开发

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

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

psonrie/geolocation

Composer 安装命令:

composer require psonrie/geolocation

包简介

Laravel service provider to retrieve a users location by their IP Address

README 文档

README

Travis CI Scrutinizer Code Quality Latest Stable Version Total Downloads License

Geo Location

Laravel service provider to retrieve a users location from their IP address using freegeoip.app or geolocation-db service.

Requirements

  • Laravel >= 5.5
  • PHP 7.0 or greater
  • cURL extension enabled

Installation

Via Composer

composer require psonrie/geolocation

Note: If you're using Laravel 5.5 or above, you can skip the registration of the service provider, as it is registered automatically.

Add the service provider in config/app.php:

Psonrie\GeoLocation\GeoLocationServiceProvider::class,

Publish the config file:

php artisan vendor:publish --provider="Psonrie\GeoLocation\GeoLocationServiceProvider"

Usage

Retrieving a users location

$geoLocation = new GeoLocation();

$response = $geoLocation->get('46.24.247.56');

// Returns instance of Psonrie\GeoLocation\Response

Psonrie\GeoLocation\Response {
  ip: "46.24.247.56"
  countryCode: "ES"
  countryName: "Spain"
  regionCode: "CT"
  regionName: "Catalonia"
  cityName: "Barcelona"
  zipCode: "08004"
  timeZone: "Europe/Madrid"
  latitude: "41.3891"
  longitude: "2.1611"
  metroCode: 0
}

Contribute

Contributions are welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固