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.
Basis: initial assessment derived from the v1.2.0 release notes only (no prior baseline, no source review, no test/CI evidence). Treat confidence as medium-low until the questions below are answered.
Architecture fit
djouamaah/laravel-algeria is a narrow, domain-specific data package: wilayas/communes reference data plus query helpers. It is a good fit where the product needs Algerian administrative geography as reference data (address forms, delivery zone pickers, branch/agent assignment, coverage maps) and does not want to own curation of that dataset.Algeria::nearest(), Algeria::distance(), Commune::distanceTo(), plus a nearest-commune HTTP route). That is a meaningful scope expansion: it now participates in request-path logic and, if the route ships enabled, in the public API surface.communes table gains latitude/longitude). The package owns a table in your database — acceptable, but it means your schema history is now partly vendor-driven.Integration feasibility
composer update → php artisan migrate → php artisan algeria:seed. Additive migration (two nullable columns) is the easiest class of schema change to land; no table rebuild or type change implied.composer update silently expands your public attack surface — that changes the review from "routine bump" to "coordinated change".Technical risk
algeria:seed" with no statement on whether the seeder upserts, truncates, or re-inserts. If commune primary keys are regenerated, any FK in your app (addresses, orders, agents, delivery zones) pointing at communes.id is corrupted, and the damage is silent. Must be confirmed before production.GET /api/algeria/communes/nearest?lat=&lng=&limit= — notes give no indication of validation on lat/lng ranges, a hard cap on limit, throttling, auth, or response shape. Any unauthenticated compute endpoint is an abuse and cost vector.nearest() is called per-request or per-row, cost compounds quietly.THIRD-PARTY-NOTICES.md is a genuine positive — it signals the maintainer is thinking about attribution. But the sources named (Wikidata, kossa/algerian-cities, geoalgeria) have mixed licensing, and OSM-derived datasets are typically ODbL (share-alike on derivative databases). If you redistribute the enriched commune table — including inside a product your customers can export from — you need a legal read, not an engineering one.Key questions
algeria:seed truncate, upsert, or insert? Are communes.id values stable across v1.1.0 → v1.2.0?nearest route opt-in or auto-registered? Is it namespaced/versioned, throttled, and capped?Algeria::distance() / Commune::distanceTo() — km, haversine, great-circle? Is altitude ignored (it is, presumably)?nearest() executed in SQL or in PHP over a hydrated collection? Any index on (latitude, longitude) in the migration?latitude/longitude nullable, and what do the helpers do for a commune with a null point?geoalgeria contribution, and does ODbL share-alike reach our application database or API responses?down() implemented for the new migration, and is the seed reversible?Stack fit
Algeria::nearest()/distanceTo() in your own small GeoLocator/CommuneResolver service rather than calling package statics from controllers, models, and jobs. Given the API route and helper signatures may still be settling (0.x→1.x pace), one thin seam keeps a future swap or pin cheap.Migration path (v1.1.0 → v1.2.0)
composer update → migrate → algeria:seed, then diff commune IDs, row count, and a sample of FK joins before/after.communes (and any FK-referencing tables) immediately before the production seed, with a named restore procedure and a tested down().Compatibility
migrate — the risky step is the seed, not the schema. That lets you split the change: ship migration + code first (helpers unused), then run the seed in a controlled window.composer update; a minor-version bump is not a compatibility guarantee by itself.Sequencing
Maintenance
composer update. Add it to the dependency-upgrade checklist and to the release runbook.Support
Scaling
nearest() inside loops, per-row enrichment, or per-request geocoding will multiply into a table scan each time.Failure modes
communes half-populated. The seeder must be transactional or resumable; verify before running it in a deploy hook.composer update — exposure expands without anyone deciding to expand it.Ramp-up
How can I help you explore Laravel packages today?