djouamaah/laravel-algeria
Laravel package for Algeria: ships wilayas and communes data with models, migrations, seeders, and helpers so you can add Algerian regions, postal codes, and location dropdowns to your app quickly.
latitude/longitude for all 1,541 communes (cross-checked across Wikidata, kossa/algerian-cities, geoalgeria, plus manual corrections). This removes the main reason to buy a commercial MENA dataset or stand up an internal geocoding pipeline just to get commune centroids.Algeria::nearest(), Algeria::distance(), and Commune::distanceTo() make proximity a first-class product primitive — store/branch locator, "nearest agency," delivery-zone assignment, courier dispatch, and serviceability checks at checkout.GET /api/algeria/communes/nearest?lat=&lng=&limit= endpoint is a ready-made contract for mobile and partner integrations. It lets you ship a geo capability to clients without designing a new API surface first, and it is a plausible standalone differentiator for B2B/partner deals.THIRD-PARTY-NOTICES.md gives legal and procurement a licensable trail for the data sources. This is the artifact that unblocks signing off on "we own/redistribute this dataset" questions, which typically stalls geo features late.php artisan migrate followed by php artisan algeria:seed. That is an additive change, but it makes seeding a hard dependency of the release — a scheduling and rollback decision for the PM, not just engineering.Adopt when:
composer update → migrate → algeria:seed).Look elsewhere when:
distance() is straight-line; anything logistics-grade needs a routing engine.To executives: This release turns a static reference list into a location engine. We now have verified coordinates for every commune in Algeria and can answer "what's nearest / how far" inside our own database — no new vendor contract, no per-request geocoding fees, and a documented license trail for the source data. It unlocks store locator, distance-based delivery pricing, and partner geo-APIs as near-term roadmap items rather than new budget lines. Low risk: the upgrade is additive and requires one migration plus a reseed.
To engineering: v1.2.0 is a non-breaking, additive upgrade from v1.1.0. It adds latitude/longitude columns to communes via a new migration, three distance helpers (Algeria::nearest(), Algeria::distance(), Commune::distanceTo()), and a new public route GET /api/algeria/communes/nearest?lat=&lng=&limit=. Upgrade is composer update → php artisan migrate → php artisan algeria:seed. Two things to plan for: the seeder is now a release dependency (put it in the runbook, verify idempotency in staging, and check rollback), and distance is great-circle, not routing — if we later need travel time, that is a separate integration. The API route also needs the usual treatment for rate limiting, input validation on lat/lng/limit, and caching.
How can I help you explore Laravel packages today?