devrabiul/laravel-geo-genius
Laravel GeoGenius adds IP geolocation, automatic timezone detection/conversion, locale & translation helpers, and a country picker with phone formatting/validation for Laravel. Works with Livewire and supports cookies or headers for detection.
Pros:
Illuminate\Auth\Events\Authenticated) for real-time geo-data updates.Cons:
ipwho.is, ip-api.com) introduces latency and potential downtime risks. Mitigation requires fallback strategies (e.g., offline mode) and monitoring.config/laravel-geo-genius.php) may lead to "magic" behavior if not thoroughly documented or audited during integration.app()->setLocale()) and authentication systems (e.g., storing timezone in users table).initIntlPhoneInput()) requires intl-tel-input JS library, adding a frontend dependency. This must be accounted for in build pipelines (e.g., Vite/Webpack).{{ laravelGeoGenius()->geo()->getCountry() }}) simplify backend-to-frontend data flow but may require template adjustments.timezone column is provided, but schema changes (e.g., adding country_code to users) may require customization for specific use cases.ipwho.is, ip-api.com) may have rate limits, downtime, or deprecated endpoints. The package’s caching mitigates this but doesn’t eliminate it.Illuminate\Cache\Repository with fallback logic).scheduler (e.g., ping APIs periodically).SESSION_DRIVER=database) for consistency.php artisan geo:cache-warmup).App::setLocale()).ipwho.is, ip-api.com) acceptable, or should we evaluate alternatives (e.g., MaxMind GeoIP2) for lower latency/cost?GeoLocationService, TimezoneService) can be bound manually for finer control.GeoDataUpdated) to sync geo-data with other systems (e.g., analytics).geo:detect) for async processing.laravelGeoGenius()->geo()->getCountry()).intl-tel-input (~10KB). Bundle via Vite/Webpack or CDN.country_code to users) require manual adjustments.127.0.0.1, mobile networks, proxies).php artisan geo:add-timezone-column users to add columns to existing tables.GeoDataBackfillJob).config/laravel-geo-genius.php to use local fallback data (e.g., cached JSON) when APIs are down.'geo' => [
'fallback_data' => [
'ip' => '1.1.1.1',
'country' => 'US',
'timezone' => 'America/New_York',
],
],
league/geoip by namespacing service bindings.SESSION_DRIVER=redis).intl-tel-input for phone validationHow can I help you explore Laravel packages today?