Looking to hire Laravel developers? Try LaraJobs

laravel-ip-service maintained by mostafaabdelbaset

Description
A Laravel package to get the client's country using the ip. A wrapper for http://ip2nation.com
Last update
2020/12/30 21:09 (dev-master)
License
Links
Downloads
11
Tags

Comments
comments powered by Disqus

Laravel IP Service

Tries to guess the country code of the client, using his IP.

Installation

Download and import the ip database from ip2nation.com

Usage

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