dimsav / laravel-ip-service by dimsav

A Laravel package to get the client's country using the ip. A wrapper for http://ip2nation.com
47
117
7
Package Data
Maintainer Username: dimsav
Maintainer Contact: ds@dimsav.com (Dimitris Savvopoulos)
Package Create Date: 2014-12-29
Package Last Update: 2020-01-10
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-03-26 15:01:21
Package Statistics
Total Downloads: 47
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 117
Total Watchers: 7
Total Forks: 14
Total Open Issues: 2

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