dimsav/laravel-ip-service

A Laravel package to get the client's country using the ip. A wrapper for http://ip2nation.com
50 118
Install
composer require dimsav/laravel-ip-service
Latest Version:v1
PHP:>=5.4.0
License:MIT
Last Updated:Jan 10, 2020
Links: GitHub  ·  Packagist
Maintainer: dimsav

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

Related Packages

hibit-dev/geodetect

Automatically detect user's geo data based on their IP address

26,963 23
mchev/banhammer

Banhammer for Laravel allows you to ban any Model by key and by IP.

131,338 374
stevebauman/location

Retrieve a user's location by their IP Address

9,499,400 1,308
sun/country

Sun Country is the package that helps you to get the country name & dialing code...

17,143 10