Download the PHP package alfonsobries/laravel-geo without Composer
On this page you can find all versions of the php package alfonsobries/laravel-geo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alfonsobries/laravel-geo
More information about alfonsobries/laravel-geo
Files in alfonsobries/laravel-geo
Package laravel-geo
Short Description Geo-location data sync package for Laravel
License MIT
Informations about the package laravel-geo
Laravel Geo
Geo-location data package for Laravel. Syncs continents, countries, divisions, cities (with translations), and a MaxMind IP geolocation database from geo.vexilo.com. Everything runs locally after sync.
Installation
Configuration
Add to your .env:
Full config at config/geo.php:
Syncing Data
Sync Modes
- Auto (default) — Detects the best mode. Uses dump for initial sync (no local data), incremental for daily updates.
- Dump — Downloads CSV dump files from the server. Fast bulk import with truncate + reimport. Best for initial setup or full re-sync.
- Incremental — Uses
updated_afterwatermarks to only fetch changed records. Fetches deletions from the server. Best for daily scheduled updates.
The sync is:
- Manifest-driven — compares checksums, skips tables that haven't changed
- Idempotent — uses upserts keyed on
geoname_id/alternate_name_id - Dependency-aware — syncs in order: continents -> countries -> divisions -> cities
- Retry-capable — HTTP requests retry 3x with backoff on failure
Add to your scheduler for automatic updates:
IP Geolocation
Resolve IP addresses to local geo models using the synced MaxMind database. Zero API calls at runtime.
Results are cached by IP (configurable via geo.cache.ttl).
Models
Traits & Scopes
Add geo relationships and query scopes to your models:
Each trait provides a relationship and query scopes:
Factories
Available for testing:
Testing
License
MIT
All versions of laravel-geo with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
geoip2/geoip2 Version ^3.0