2017 © Pedro Peláez
 

library laravel-4-freegeoip

Laravel 4 Library for detecting geogpraphical location info of your visitors

image

buonzz/laravel-4-freegeoip

Laravel 4 Library for detecting geogpraphical location info of your visitors

  • Thursday, January 8, 2015
  • by buonzz
  • Repository
  • 0 Watchers
  • 11 Stars
  • 3,911 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 6 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

FreeGeoIP for Laravel 4

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Laravel 4 Library for calling http://freegeoip.net/ API., (*2)

In contrary to all other packages wherein it requires that you have the geoip database in your filesystem, this library calls a free service So you dont really have to worry about downloading and maintaining geoip data from Maxmind in your own server., (*3)

Just install the package, add the config and it is ready to use!, (*4)

Requirements

  • PHP >= 5.3.7
  • cURL Extension

Installation

composer require buonzz/laravel-4-freegeoip:dev-master

Add the service provider and facade in your config/app.php, (*5)

Service Provider, (*6)

Buonzz\GeoIP\Laravel4\ServiceProviders\GeoIPServiceProvider

Facade, (*7)

'GeoIP'            => 'Buonzz\GeoIP\Laravel4\Facades\GeoIP',

Configuration

This library supports optional configuration., (*8)

To get started, first publish the package config file:, (*9)

$ php artisan config:publish buonzz/laravel-4-freegeoip
  • freegeopipURL: defines the URL of the FreeGeoIP API. Use HTTPS or not. Default to http://www.freegeoip.net/json/.
  • timeout: defines the timeout when calling the FreeGeoIP API (in seconds). Default to 30.

Usage

Get country of the visitor, (*10)

GeoIP::getCountry();  // returns "United States"

Get country code of the visitor, (*11)

GeoIP::getCountryCode();  // returns "US"

Get region of the visitor, (*12)

GeoIP::getRegion();  // returns "New York"

Get region code of the visitor, (*13)

GeoIP::getRegionCode();  // returns "NY"

Get city of the visitor, (*14)

GeoIP::getCity();  // returns "Buffalo"

Get zip code of the visitor, (*15)

GeoIP::getZipCode();  // returns "14221"

Get latitude of the visitor, (*16)

GeoIP::getLatitude();  // returns "42.9864"

Get longitude of the visitor, (*17)

GeoIP::getLongitude();  // returns "-78.7279"

Get metro code of the visitor, (*18)

GeoIP::getMetroCode();  // returns "514"

Get area code of the visitor, (*19)

GeoIP::getAreaCode();  // returns "716"

Credits

  • Alexandre Fiori for the awesome http://freegeoip.net web api
  • MaxMind for the data

The Versions

08/01 2015

dev-master

9999999-dev http://www.darwinbiler.com/laravel-4-freegeoip/docs/v1.0.1

Laravel 4 Library for detecting geogpraphical location info of your visitors

  Sources   Download

MIT

The Requires

  • php >=5.3.7
  • ext-curl *
  • lib-curl *

 

The Development Requires

by Darwin Biler

geoip maps freegeoip.net ip to location track location retrieve location no local geodatabase required

08/01 2015

v1.0.3

1.0.3.0 http://www.darwinbiler.com/laravel-4-freegeoip/docs/v1.0.1

Laravel 4 Library for detecting geogpraphical location info of your visitors

  Sources   Download

MIT

The Requires

  • php >=5.3.7
  • ext-curl *
  • lib-curl *

 

The Development Requires

by Darwin Biler

geoip maps freegeoip.net ip to location track location retrieve location no local geodatabase required

07/09 2014

v1.0.2

1.0.2.0 http://www.darwinbiler.com/laravel-4-freegeoip/docs/v1.0.1

Laravel 4 Library for detecting geogpraphical location info of your visitors

  Sources   Download

MIT

The Requires

  • php >=5.3.7
  • ext-curl *
  • lib-curl *

 

The Development Requires

by Darwin Biler

geoip maps freegeoip.net ip to location track location retrieve location no local geodatabase required

19/04 2014

v1.0.1

1.0.1.0

Laravel 4 Library for detecting geogpraphical location info of your visitors

  Sources   Download

MIT

The Requires

  • php >=5.3.7
  • ext-curl *
  • lib-curl *

 

The Development Requires

by Darwin Biler

geoip maps freegeoip.net ip to location track location retrieve location no local geodatabase required

19/04 2014

v1.0.0

1.0.0.0

Laravel 4 Library for detecting geogpraphical location info of your visitors

  Sources   Download

MIT

The Requires

  • php >=5.3.7
  • ext-curl *
  • lib-curl *

 

The Development Requires

by Darwin Biler

geoip maps freegeoip.net ip to location track location retrieve location no local geodatabase required