dimsav / laravel-ip-service by dimsav

A Laravel package to get the client's country using the ip. A wrapper for http://ip2nation.com
48
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-11-22 03:16:51
Package Statistics
Total Downloads: 48
Monthly Downloads: 1
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();