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

sumanion/laravel-cloudflare

Simple way to determine real client IP and country when using CloudFlare

3,145 9
smalldogs/ip2country

Laravel package to lookup the country associated with an IPv4 address

979 22
jormin/laravel-ip

解析IP地址,使用 [ipip.net](http://www.ipip.net/) 的服务。

4,262 3
dougsisk/laravel-country-state

Country & state helper for Laravel.

1,955,874 168
lab404/laravel-auth-checker

Laravel Auth Checker allows you to log users authentication, devices authenticat...

167,642 223