承接 riteshptl21/geoip 相关项目开发

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

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

riteshptl21/geoip

Composer 安装命令:

composer require riteshptl21/geoip

包简介

Supports Maxmind GeoIP services

README 文档

README

Description

Latest Stable Version Total Downloads

Geoip is a Laravel package that aims to seamlessly integrate MaxMind functionality for determine the geographical location of IP addresses in laravel.

Installation

Add geoip to your composer.json file:

"riteshptl21/geoip": "0.1.*"

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

Add the service provider to your Laravel application config:

'Riteshptl21\Geoip\GeoipServiceProvider'

Create configuration file using artisan

$ php artisan config:publish riteshptl21/geoip

Once you fire this command you see config file at app/config/packages/riteshptl21/geoip/config.php and set config at there.

Usage

Get the location data for a website visitor:

$location = Geoip::getLocation();

When an IP is not given the $_SERVER["REMOTE_ADDR"] is used.

Getting the location data for a given IP:

$location = Geoip::getLocation( '2.24.234.19' );

Note

In the case that a location is not found the fallback location will be returned with the default_location parameter that you set in config.By default default_location is like as under:

array (
    "ip"            => "127.0.0.0",
    "isoCode"       => "IN",
    "country"       => "India",
    "city"          => "Ahmedabad",
    "state_code"    => "GJ",
    "postal_code"   => "261201",
    "lat"           => 23.0333,
    "lon"           => 72.6167,
    "timezone"      => "Asia/Kolkata",
    "continent"     => "AS",
    "default"       => true
)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD
  • 更新时间: 2016-02-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固