dimsav / laravel-ip-service
一个用于通过IP获取客户端国家的Laravel扩展包。是对http://ip2nation.com的封装。
v1
2014-12-29 15:57 UTC
Requires
- php: >=5.4.0
- illuminate/support: ~4.0
Requires (Dev)
- mockery/mockery: ~0.9
- orchestra/testbench: ~2.0
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-09-10 23:51:52 UTC
README
尝试通过客户端的IP猜测国家代码。
安装
下载 并从ip2nation.com导入IP数据库。
使用方法
$service = App::make('Dimsav\IpService\IpService'); // country code for the given ip address echo $service->getCountryCodeFromIp('123.123.123.123'); // country code for the client's ip address echo $service->getCountryCodeFromClientIp();