devrabiul/laravel-geo-genius
Laravel GeoGenius adds IP-based geolocation, automatic timezone detection/conversion, locale detection with translation and number conversion, plus a country picker and phone formatting/validation. Works with Livewire and supports cookies or headers.
Pros:
config/laravel-geo-genius.php) and artisan commands for migrations/translations.Cons:
ipwho.is, ip-api.com) for geolocation, introducing latency and potential downtime risks.intl-tel-input for phone validation), making it adaptable to any frontend (React, Vue, Alpine.js, etc.).App\Http\Middleware\DetectGeoData) for automatic user context enrichment.intl-tel-input, which may introduce frontend complexity or compatibility issues with older browsers.ipwho.is) sufficient, or are alternatives (e.g., MaxMind) needed?intl-tel-input) conflict with existing builds?intl-tel-input (~100KB JS/CSS). Works with any framework (Blade, Livewire, Inertia.js, etc.).composer require devrabiul/laravel-geo-genius
php artisan vendor:publish --provider="Devrabiul\LaravelGeoGenius\LaravelGeoGeniusServiceProvider"
php artisan migrate
config/laravel-geo-genius.php (e.g., API keys, caching, locales).php artisan geo:add-language en
php artisan geo:translations-generate --locale=en
app/Http/Kernel.php to auto-detect geo data:
\Devrabiul\LaravelGeoGenius\Http\Middleware\DetectGeoData::class,
{{ laravelGeoGenius()->geo()->getCountry() }}.{!! laravelGeoGenius()->initIntlPhoneInput() !!}
<input type="tel" name="phone">
laravelGeoGenius()->geo()->simulateLocation() for mocking).ipwho.is (free tier: 1,000 requests/day). Paid plans needed for high traffic.intl-tel-input (v19.x) for phone input. Ensure no conflicts with existing JS bundles.laravelGeoGenius() in Livewire components.intl-tel-input into forms.simulateLocation()).ipwho.is/ip-api.com to avoid rate limits. Consider fallback APIs (e.g., MaxMind) if needed.php artisan geo:translations-generate --locale=en
intl-tel-input or Laravel core.app.locale).intl-tel-input issues (e.g., CSS conflicts, mobile compatibility).How can I help you explore Laravel packages today?