torann/geoip
GeoIP for Laravel resolves visitor location and currency from IP addresses via configurable services. Integrates with Laravel, supports multiple drivers/providers, and lets you publish config to choose and tune your lookup service.
GeoIP facade and service bindings (bind('geoip', ...)) enable clean, testable, and maintainable code while adhering to Laravel’s dependency injection principles.GeoIPMiddleware allows geolocation resolution at the request level, enabling use cases like geotargeted routing, compliance enforcement, or dynamic content delivery without cluttering business logic. This aligns with Laravel’s middleware pipeline and HTTP lifecycle.geoip.resolved) for decoupled extensions, such as analytics, logging, or custom business logic. This leverages Laravel’s observer pattern and event system, promoting loose coupling and extensibility.geoip:location:{ip}) ensures compatibility with Redis, Memcached, or file-based caching, reducing latency for high-traffic applications.config/geoip.php (published via php artisan vendor:publish) allows runtime provider switching, API key management, and feature toggling without code changes. This adheres to Laravel’s 12-factor app principles and configuration-first approach.Provider Strategy:
Performance Requirements:
Data Usage:
Integration Points:
Maintenance and Updates:
Failure Modes:
Prerequisites:
guzzlehttp/guzzle, illuminate/cache).Installation:
composer require torann/geoip
php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider"
config/geoip.php) and update API keys/providers.Configuration:
Testing:
Deployment:
Phase 1: Core Integration (2–4 weeks):
Phase 2: Feature Enablement (1–2 weeks):
Phase 3: Monitoring and Iteration (Ongoing):
config/geoip.php for provider changes or feature toggles.storage/logs/laravel.log) to debug geolocation resolution failures.How can I help you explore Laravel packages today?