dimsav/laravel-ip-service

一个用于通过IP获取客户端国家的Laravel扩展包。是对http://ip2nation.com的封装。

v1 2014-12-29 15:57 UTC

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();