vanthao03596/laravel-hanhchinhvn
Laravel package for Vietnam administrative divisions: import and query provinces, districts, and wards/communes with Eloquent models, migrations, and data seeding for building address forms and location-based features.
What the package is. laravel-hanhchinhvn is a thin Laravel wrapper around the Vietnamese administrative hierarchy dataset (province → district → ward/commune). Expected deliverables: Eloquent models for the three tiers, publishable migrations, a seeder or import command, and relationship helpers. This is a data bundle with an ORM veneer, not an application service — the value is the dataset and the code mappings, not the PHP code.
Architecture fit. Good structural fit for Laravel domain modelling: three-tier self-referential hierarchy maps cleanly to hasMany/belongsTo, and address selection (checkout, KYC, shipping, tax registration) is a common, well-understood requirement. The package's natural integration points — a provinces / districts / wards table trio plus FK columns on your address entities — are conventional and low-friction. The fit is architecturally sound and temporally poor (see risk).
Integration feasibility. Straightforward mechanically: composer require, publish migrations/config, seed. The friction is not installation, it is everything after: verifying dataset vintage, mapping the package's internal IDs to the identifiers your other systems use (GSO codes, logistics provider codes, e-invoice tax codes), and deciding whether your domain models FK into vendor-owned tables. That last decision is the one that determines exit cost.
Technical risk. Ranked:
| Risk | Severity | Note |
|---|---|---|
| Dataset staleness | Critical | Last release 2022-03-04. Vietnam has since restructured local government twice — commune-level mergers (2023–2024) and the 2025 move to a two-tier model (province + commune, district level abolished; ~63 → 34 provinces, ~10k → ~3.3k communes). A 2022 snapshot is structurally, not just cosmetically, outdated. Verify the current legal state before any design decision — this single item can invalidate the package's core data model. |
| Single-maintainer abandonment | High | 39 stars, no release in 3+ years, one author. Assume zero upstream fixes. |
| Schema rigidity | Medium | If migrations hard-code three tiers, the two-tier reality forces a schema fork, not a data refresh. |
| ID instability | Medium | If PKs are dataset-local rather than official GSO codes, every data refresh renumbers rows and breaks stored FKs. |
| Encoding/normalisation | Low–Medium | Vietnamese diacritics require utf8mb4; search/matching against user-typed addresses needs accent folding, which the package likely does not provide. |
| Laravel version drift | Low–Medium | A 2022 package plausibly caps at Laravel 8/9. Composer constraints may block Laravel 10–12 without a fork. |
Net position: treat this as a reference dataset and schema pattern, not a runtime dependency. Score 0.495 with these signals reads correctly as "useful starting point, do not bet the address model on it."
Key questions to resolve before committing:
composer.json?Stack fit. Native Laravel/Eloquent — no impedance mismatch, no external service, no runtime dependency on a third party. That is genuinely attractive for an address reference table: it is read-mostly, small, and cacheable. The package fits inside the monolith cleanly; it should not be allowed to shape the domain model of your address entities.
Recommended migration path — fork, don't depend.
acme/vn-administrative-data.province and ward, with district as a nullable/deprecated dimension, not a required join.AdministrativeUnitRepository) so the data source is swappable and the package is not referenced directly from controllers.Compatibility. Validate composer.json constraints against your Laravel/PHP target first — this is a 10-minute check that can end the evaluation. Require MySQL/Postgres utf8mb4 (or equivalent) and confirm collation behaviour for Vietnamese text. Test accent-insensitive search explicitly.
Sequencing.
Maintenance. Effectively 100% internal. With no upstream releases since March 2022, assume you own the code and the data. Budget for an annual (or event-driven) data refresh — Vietnamese administrative units change by decree, and changes are not rare. The refresh should be a repeatable, tested pipeline, not a manual SQL exercise; if it is manual, it will not happen on schedule.
Support. Community-only, no SLA, no vendor. Documentation is likely Vietnamese-language, which is fine for a Vietnamese-market team but is a bus-factor consideration for a distributed or outsourced team. Internal knowledge should be documented in English alongside.
Scaling. A non-issue. The dataset is on the order of tens of thousands of rows at most (pre-2025: ~63 / ~700 / ~11k; current two-tier: ~34 / ~3.3k). Load once into a cache (Redis or a bootstrapped array/config) and serve address dropdowns from memory. Read-mostly, near-zero write volume, negligible DB pressure. This is one of the least operationally demanding integration surfaces you will own.
Failure modes to design against.
Ramp-up. Low for any Laravel developer — installation and familiar Eloquent consumption is hours, not days. The real ramp-up cost is domain: understanding Vietnamese administrative reform cadence and the address-data expectations of logistics, e-invoicing, and tax systems. Assign one owner who tracks administrative changes; that person, not the code, is the actual asset.
TPM recommendation. Proceed with a bounded spike, but plan to fork and re-source the data. Adopt the package's schema pattern and dataset structure; reject it as a long-lived runtime dependency on maintenance-risk and data-currency grounds. Gate all downstream work on confirming the current administrative tier model — that answer determines whether this is a data refresh or a redesign.
How can I help you explore Laravel packages today?