Skip to content

bkhim/laravel-geolocation

Repository files navigation

Laravel Geolocation

IP geolocation + fraud prevention for Laravel.
Detect proxy/VPN/Tor, trigger MFA on suspicious logins, personalize user experience.

Latest Version Total Downloads Tests License


✨ One Line of Code

$details = Geolocation::lookup();
echo $details->getCity(); // "Mountain View"

🛡️ Security First

if ($details->isProxy() || $details->isTor()) {
    return redirect()->route('mfa');
}

🌍 6 Providers. One API.

Provider Free Tier Fraud Score Proxy Detection
ipapi.co 30k/mo
IP2Location.io 50k/mo
IpInfo Unlimited*
MaxMind Unlimited
IPStack 100/mo
IPGeolocation 1k/mo

*IpInfo Lite: country only

→ Compare all providers


⚡ Quick Install

composer require bkhim/laravel-geolocation
php artisan vendor:publish --provider="Bkhim\Geolocation\GeolocationServiceProvider"

📚 Documentation

🎯 Use Cases

  • 🔐 Login Security – MFA triggers on suspicious locations
  • 💰 E-commerce – Local currency, geo-blocking
  • 📊 Analytics – Visitor location tracking
  • 🛡️ Fraud Prevention – Proxy/VPN/Tor detection

Built for Laravel 10–13 | PHP 8.2+ | MIT License

About

Modern Laravel geolocation package with 5+ drivers (IpInfo, MaxMind, IPStack, IPGeolocation, IP-API), Laravel 12+ support, PHP 8.2+, and enhanced features

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors

Languages