Download the PHP package aestheticraza/laravelglobe without Composer
On this page you can find all versions of the php package aestheticraza/laravelglobe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aestheticraza/laravelglobe
More information about aestheticraza/laravelglobe
Files in aestheticraza/laravelglobe
Package laravelglobe
Short Description Comprehensive Countries, States, Cities, Currencies, and Timezones for Laravel.
License MIT
Informations about the package laravelglobe
🌍 LaravelGlobe
Enterprise-Grade, Fully Independent Geographic & Localization Package for Laravel
LaravelGlobe is a highly normalized, strictly typed, and independently maintained geographic engine for Laravel. Instead of relying on bloated external APIs (which cause rate limits and slow load times), LaravelGlobe ships with its own proprietary internal JSON datasets for Countries, States, 150,000+ Cities, Currencies, Timezones, and Postal Codes.
This package gracefully solves geographical overlap anomalies via Advanced Many-to-Many Pivot tables (e.g., countries with multiple timezones, border-cities with dual currencies).
🚀 Why LaravelGlobe? (The Benefits)
- Massive Offline Dataset: 250 Countries, 4,963 States, 148,000+ Cities, 423 Timezones, 162 Currencies, and 5,000+ Postal Codes—all bundled internally!
- Zero OOM (Out of Memory) & High Performance:
LaravelGlobeSeederimports over 150,000 records without crashing PHP by disabling exact MySQL FK checks, chunking the massive city data into 10 smaller JSON buffers, and using raw batch DB inserts. - Advanced M-to-M Pivot Relationships:
country_currency(e.g., Zimbabwe uses USD, ZWL, and ZAR).country_timezone(e.g., the United States and Russia span multiple timezones).city_timezone&state_timezone(Accurate boundary timezone overrides).city_currency(Border cities like Geneva accept dual currencies: CHF + EUR).
- Instant Eloquent Inheritance: Attach the elegant
HasLocationTrait across any Model in your system (User, Employee, Order) to inherit massive geographic scopes. - Geospatial Proximity Search: Use trigonometric calculations natively via
scopeNearby($lat, $lng, $radius). It utilizesST_Distance_Sphereon MySQL 5.7+ or falls back to a robust Haversine formula automatically.
💻 Installation
-
Install the Package via Composer:
- Run the Automated Master Install Command:
This powerful command auto-publishes properties, bindings, caching setups, and migrations. Then it automatically asks to run
migrateand triggers the chunked data seeders—all within one console execution.
🛠️ Practical Real-World Examples
Here is how you actually use LaravelGlobe's data efficiently in your own application modules.
Example 1: The HasLocation Trait (Users & Orders)
You can assign geographical behavior to any application model instantly. Add use HasLocation; to a User, Employee, or Order model.
Step 1: In your migration, just ensure your table has country_id, state_id, and city_id columns.
Step 2: In your Model:
Step 3: Access it in your Controllers!
Example 2: Finding Nearby Entities (Spatial SQL Search)
When building food delivery apps, cab services, or store locators, you often need to find objects within an X kilometer radius. LaravelGlobe does the heavy math for you.
Example 3: Pivot Tables (Resolving Currencies & Timezones)
A Country does not always have just 1 Currency or 1 Timezone. LaravelGlobe introduces native Pivot Tables so your app can support enterprise payment architectures logic out of the box.
Example 4: Deep Geography & Postal Codes
Need to know the specific Latitude/Longitude and Postal Codes of a City without an external API request?
🖥️ Intelligent CLI Commands
We treat Database Syncing and Control very seriously. LaravelGlobe brings tailored Artisan commands:
(Note for Uninstall: This permanently wipes all populated geographic package data. A confirmation prompt will prevent accidental data loss.)
⚙️ Configuration & Performance Tuning
Toggling massive modules or adjusting the internal caching is just a boolean away in your config/laravelglobe.php:
🌐 Data Sources & Integrity
All structured underlying JSON buffers (/data/cities/chunk_*.json, custom_countries.json, etc.) originate from validated country-state-city and REST Countries data engines. They are shipped completely offline inside this package, meaning your production API servers will never be blocked by 3rd party rate limits or downtime.
🛡️ Author & License
Developed by: Ali Raza (@aestheticraza)
Email: [email protected]
Proprietary & Independent Geographic Engine. Maintained securely for Enterprise scaling Laravel applications.
All versions of laravelglobe with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0