2017 © Pedro Peláez
 

library ip2city

ip to city for 17mon.cn

image

mylukin/ip2city

ip to city for 17mon.cn

  • Sunday, December 10, 2017
  • by mylukin
  • Repository
  • 3 Watchers
  • 22 Stars
  • 4,925 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

ip2city

17mon for Laravel 5, (*1)

安装

  1. 安装包文件, (*2)

    composer require "mylukin/ip2city:dev-master"
    
  2. 添加 ServiceProvider 到您项目 config/app.php 中的 providers 部分:, (*3)

    'MyLukin\IP2City\ServiceProvider',
    
  3. 创建配置文件:, (*4)

    php artisan vendor:publish --provider="MyLukin\IP2City\ServiceProvider"
    

    然后请修改 config/ip2city.php 中对应的项即可。, (*5)

  4. 添加下面行到 config/app.phpaliases 部分:, (*6)

    'IP2City' => 'MyLukin\IP2City\Facade',
    

使用

由于我们已经添加了Facade IP2City,那么我们可以在控制器或者其它任何地方使用 IP2City::方法名 方式调用。, (*7)

下面写一个例子:, (*8)

<?php namespace App\Http\Controllers;

use IP2City;

class WelcomeController extends Controller {

    public function index()
    {
        var_dump(IP2City::ip2addr('115.28.212.163'));
    }
}

License

MIT, (*9)

The Versions

10/12 2017

dev-master

9999999-dev

ip to city for 17mon.cn

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Lukin

ip city ip2city 17mon