stevebauman/location
Retrieve a user’s geolocation from their IP in Laravel. Provides a simple Location facade to get city, region, country, coordinates, timezone and more, with multiple driver support (e.g., IP2Location, IP-API, MaxMind) plus caching and testing helpers.
Adopt if:
Look elsewhere if:
geoip2/geoip2 or jenssegers/agent).For Executives: *"This package unlocks location-based personalization with almost no engineering lift. For example:
For Engineers: *"This is a Laravel-native IP geolocation facade with:
$request->geo->country).Location::fake()).
Tradeoffs:maxmind (for accuracy) + ipinfo as fallback.// app/Http/Middleware/AttachGeoData.php
public function handle($request, Closure $next) {
$request->merge(['geo' => Location::get()]);
return $next($request);
}
How can I help you explore Laravel packages today?