Skip to main content
Back to packages
182 GitHub stars

devrabiul/laravel-geo-genius

View on GitHub

Description

IP-based geolocation, timezone, multilingual toolkit + country picker & phone validation for Laravel apps

Use Laravel GeoGenius in two ways:

  1. Global HelperlaravelGeoGenius() (recommended)
  2. 🧰 Service Class — manually instantiate GeoLocationService

Global Helper

laravelGeoGenius()->geo()->locateVisitor();
laravelGeoGenius()->geo()->getCountry();
laravelGeoGenius()->geo()->getTimezone();
laravelGeoGenius()->geo()->getLatitude();

Service Class

use Devrabiul\LaravelGeoGenius\Services\GeoLocationService;
 
$geo = new GeoLocationService();
 
$ip = $geo->getClientIp();
$locationData = $geo->locateVisitor();

Recent Courses on Laravel Daily