library ip-city
ip to city for 17mon.cn
zsping1989/ip-city
ip to city for 17mon.cn
- Saturday, September 16, 2017
- by zsping1989
- Repository
- 1 Watchers
- 0 Stars
- 362 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 58 % Grown
ip2city
17mon for Laravel 5, (*1)
安装
-
安装包文件, (*2)
composer require "mylukin/ip2city:dev-master"
-
添加 ServiceProvider 到您项目 config/app.php 中的 providers 部分:, (*3)
'MyLukin\IP2City\ServiceProvider',
-
创建配置文件:, (*4)
php artisan vendor:publish --provider="MyLukin\IP2City\ServiceProvider"
然后请修改 config/ip2city.php 中对应的项即可。, (*5)
-
添加下面行到 config/app.php 的 aliases 部分:, (*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)
dev-master
9999999-dev
ip to city for 17mon.cn
Sources
Download
MIT
The Requires
by
zhangshiping
ip
city
ip2city
17mon
dev-dev
dev-dev
ip to city for 17mon.cn
Sources
Download
MIT
The Requires
by
zhangshiping
ip
city
ip2city
17mon
v0.0.4
0.0.4.0
ip to city for 17mon.cn
Sources
Download
MIT
The Requires
by
zhangshiping
ip
city
ip2city
17mon
v0.0.3
0.0.3.0
ip to city for 17mon.cn
Sources
Download
MIT
The Requires
by
zhangshiping
ip
city
ip2city
17mon