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.
Weβre excited to announce v1.6 of Laravel GeoGenius β bringing a major improvement to session handling and flow stability.
This update focuses on making the package more predictable, performant, and developer-friendly when dealing with user state across requests.
The session handling mechanism has been refactored and optimized to ensure:
This results in a more stable and efficient user experience, especially in multi-request flows and Livewire interactions.
composer require devrabiul/laravel-geo-genius
If you find this update helpful, consider β starring the repo and sharing feedback!
LanguageTraitIf you are running PHP 8.2+ or Laravel 11/12, this release eliminates deprecation warnings and ensures smoother long-term support.
Restrict to Specific Countries
You can now limit the phone input country dropdown to only the countries you choose.
Add the configuration in config/laravel-geo-genius.php:
'phone_input' => [
'initial_country' => env('GEO_PHONE_DEFAULT_COUNTRY', 'us'),
'only_countries_mode' => true, // enable restriction
'only_countries_array' => ['us', 'gb'], // allowed countries only
// other options β¦
],
With this enabled, your phone input will only show the specified countries, ignoring others.
Improved Data Attributes & JSON Encoding
When only_countries_mode is true, the only_countries_array is now output as a JSON-encoded string in the HTML data-only-countries-array attribute to ensure more reliable parsing in JavaScript.
Better JS Integration The intl-tel-input initialization script now safely handles:
onlyCountries when mode is enabledonly_countries_mode is false, the data-only-countries-array is always set to an empty array ([]) to avoid mis-parsing.CHANGELOG.md with v1.4 entry and links to configuration and JS detailsv1.3 Update β Advanced translation automation, smarter artisan commands, and an even smoother multilingual developer experience.
π Auto-Generate Translations from Codebase β New command scans your entire project for translate('...') calls and builds the messages.php file automatically:
php artisan geo:translations-generate --locale={locale}
Example:
php artisan geo:translations-generate --locale=en
π Batch & Continuous Translation β Control how messages are translated:
geo:translate-language-batch β Translate a fixed batch of strings.geo:translate-language-all β Keep translating until all are done.Examples:
php artisan geo:translate-language-batch en --count=50
php artisan geo:translate-language-all en --count=300
β‘ Streamlined Workflow β Combine with existing geo:add-language and geo:translate-language to go from detection β generation β translation seamlessly.
π Smarter File Handling β Automatic detection and creation of missing language files (messages.php, new-messages.php) with improved reliability.
π Even Better Multilingual Support β Cleaner, faster, and more developer-friendly tooling for global apps.
composer update devrabiul/laravel-geo-genius
v1.2 Update β Powerful translation command, better multilingual workflow, and improved developer experience.
π Translate Missing Strings via Artisan β New command automatically translates strings in new-messages.php for any locale:
php artisan geo:translate-language {locale}
Examples:
php artisan geo:translate-language bn
php artisan geo:translate-language bn --count=20 # translate 20 at a time
π Enhanced Auto-Translation β Smoother detection and translation of user messages based on Geo-IP.
π§ Configurable Translation Count β Limit how many strings get translated per run with --count option.
π Improved Language File Handling β Better checks for resources/lang/{locale}/new-messages.php and clearer console feedback.
β‘ Refined Internal Services β Optimised code paths for faster translations and lower API usage.
π Backward Compatible β All previous features (timezone, geolocation, multilingual, country picker, Livewire support) remain fully functional.
composer update devrabiul/laravel-geo-genius
php artisan vendor:publish --provider="Devrabiul\\LaravelGeoGenius\\LaravelGeoGeniusServiceProvider"
v1.1 Update β Enhancements for multilingual support, user language management, and code optimization.
π·οΈ Add New Language via Artisan β Use the new command to add language files easily:
php artisan geo:add-language {locale}
Example:
php artisan geo:add-language bn
π Automatic User Language Detection β Detect and set the language based on visitor preferences or browser settings.
π€ Per-User Language Switching β Change the current userβs language programmatically:
laravelGeoGenius()->language()->changeUserLanguage('bn');
β‘ Optimized Code & Performance β Refactored language handling and internal services for faster response and lower resource usage.
π Backward Compatible β All previous features remain fully functional (geolocation, timezone, country picker, phone validation, caching, Livewire support).
composer update devrabiul/laravel-geo-genius
php artisan vendor:publish --provider="Devrabiul\\LaravelGeoGenius\\LaravelGeoGeniusServiceProvider"
Initial stable release of Laravel GeoGenius β a complete toolkit for geolocation, timezone management, multilingual support and country-aware phone inputs in Laravel apps.
intl-tel-input integration with auto country detection and built-in number validationtimezone column to your users tablecomposer require devrabiul/laravel-geo-genius
php artisan vendor:publish --provider="Devrabiul\\LaravelGeoGenius\\LaravelGeoGeniusServiceProvider"
How can I help you explore Laravel packages today?