Skip to main content
Back to packages
2,224 GitHub stars

Torann/laravel-geoip

View on GitHub

Description

Determine the geographical location of website visitors based on their IP addresses

Get the location data for a website visitor:

geoip($ip = null);

Arguments:

  • $ip - The Ip to look up. If not set the application default to the remote address.

Example Location Object

\Torann\GeoIP\Location {
#attributes:array [
'ip' => '232.223.11.11',
'iso_code' => 'US',
'country' => 'United States',
'city' => 'New Haven',
'state' => 'CT',
'state_name' => 'Connecticut',
'postal_code' => '06510',
'lat' => 41.28,
'lon' => -72.88,
'timezone' => 'America/New_York',
'continent' => 'NA',
'currency' => 'USD',
'default' => false,
]
}

Recent Courses on Laravel Daily