dimsav/laravel-ip-service

A Laravel package to get the client's country using the ip. A wrapper for http://ip2nation.com

Installs: 50

Dependents: 0

Suggesters: 0

Security: 0

Stars: 118

Watchers: 6

Forks: 14

Open Issues: 2

pkg:composer/dimsav/laravel-ip-service

v1 2014-12-29 15:57 UTC

This package is auto-updated.

Last update: 2025-09-11 01:55:59 UTC


README

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