Join 25,000+ Laravel Developers and join the free Laravel Newsletter
Laravel Packages / January 03, 2015

Laravel IP to Country

Dimitris Savvopoulos released a new Laravel package to get the country by ip address. It’s a wrapper around the ip2nation database.

Here is the example usage:

$service = App::make('DimsavIpServiceIpService');

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

A nice and simple package for this task.

This appeared first on Laravel News
Laravel News Partners

Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.