PHPackages                             uocnv/vietnam-zone - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. uocnv/vietnam-zone

ActiveLibrary

uocnv/vietnam-zone
==================

VietNam Zone

v1.0.1(5y ago)05MITPHP

Since Jun 16Pushed 5y agoCompare

[ Source](https://github.com/NguyenUoc98/vietnam-zone)[ Packagist](https://packagist.org/packages/uocnv/vietnam-zone)[ RSS](/packages/uocnv-vietnam-zone/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

VietNam Zone
------------

[](#vietnam-zone)

Database đơn vị hành chính của Việt Nam

Dữ liệu được lấy trực tiếp từ Tổng Cục Thống Kê Việt Nam.

Đảm bảo luôn luôn là dữ liệu mới nhất và chính xác nhất.

Cài đặt
-------

[](#cài-đặt)

```
composer require kjmtrue/vietnam-zone
```

#### Copy file config và migration

[](#copy-file-config-và-migration)

```
php artisan vendor:publish --provider="Kjmtrue\VietnamZone\ServiceProvider"
```

#### Chỉnh sửa config và migration nếu bạn cần tuỳ biến cho dự án

[](#chỉnh-sửa-config-và-migration-nếu-bạn-cần-tuỳ-biến-cho-dự-án)

1. Đổi tên bảng

Mở file `config/vietnam-zone.php` chỉnh các cấu hình sau:

```
'tables' => [
    'provinces' => 'provinces',
    'districts' => 'districts',
    'wards'     => 'wards',
],
```

2. Đổi tên column

Mở file `config/vietnam-zone.php` chỉnh các cấu hình sau:

```
'columns' => [
    'name'        => 'name',
    'gso_id'      => 'gso_id',
    'province_id' => 'province_id',
    'district_id' => 'district_id',
],
```

3. Thêm column

Mở các file migration sau và tuỳ chỉnh theo ý thích

```
database/migrations/2020_01_01_000001_create_provinces_table.php
database/migrations/2020_01_01_000002_create_districts_table.php
database/migrations/2020_01_01_000003_create_wards_table.php
```

Run migration
-------------

[](#run-migration)

```
php artisan migrate
```

Download và import dữ liệu vào database
---------------------------------------

[](#download-và-import-dữ-liệu-vào-database)

```
php artisan vietnamzone:download
```

Todo
----

[](#todo)

- Cập nhật dữ liệu
- Download file trực tiếp từ website tổng cục thống kê

Screenshot
----------

[](#screenshot)

`select * from provinces`

```
+----+------------------------+--------+---------------------+---------------------+
| id | name                   | gso_id | created_at          | updated_at          |
+----+------------------------+--------+---------------------+---------------------+
|  1 | Thành phố Hà Nội       | 01     | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  2 | Tỉnh Hà Giang          | 02     | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  3 | Tỉnh Cao Bằng          | 04     | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  4 | Tỉnh Bắc Kạn           | 06     | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  5 | Tỉnh Tuyên Quang       | 08     | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
+----+------------------------+--------+---------------------+---------------------+

```

`select * from districts`

```
+----+-------------------+--------+-------------+---------------------+---------------------+
| id | name              | gso_id | province_id | created_at          | updated_at          |
+----+-------------------+--------+-------------+---------------------+---------------------+
|  1 | Quận Ba Đình      | 001    |           1 | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  2 | Quận Hoàn Kiếm    | 002    |           1 | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  3 | Quận Tây Hồ       | 003    |           1 | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  4 | Quận Long Biên    | 004    |           1 | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
|  5 | Quận Cầu Giấy     | 005    |           1 | 2020-06-16 17:22:30 | 2020-06-16 17:22:30 |
+----+-------------------+--------+-------------+---------------------+---------------------+

```

`select * from wards`

```
+----+--------------------------+--------+-------------+---------------------+---------------------+
| id | name                     | gso_id | district_id | created_at          | updated_at          |
+----+--------------------------+--------+-------------+---------------------+---------------------+
|  1 | Phường Phúc Xá           | 00001  |           1 | 2020-06-16 17:30:13 | 2020-06-16 17:30:13 |
|  2 | Phường Trúc Bạch         | 00004  |           1 | 2020-06-16 17:30:13 | 2020-06-16 17:30:13 |
|  3 | Phường Vĩnh Phúc         | 00006  |           1 | 2020-06-16 17:30:13 | 2020-06-16 17:30:13 |
|  4 | Phường Cống Vị           | 00007  |           1 | 2020-06-16 17:30:13 | 2020-06-16 17:30:13 |
|  5 | Phường Liễu Giai         | 00008  |           1 | 2020-06-16 17:30:13 | 2020-06-16 17:30:13 |
+----+--------------------------+--------+-------------+---------------------+---------------------+

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~297 days

Total

2

Last Release

1856d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/480a0f4dde868ba2a563f89ac15e25d9fd1640e9c04360d39cf7eabe51aba74f?d=identicon)[uocnv](/maintainers/uocnv)

---

Top Contributors

[![kimtrien](https://avatars.githubusercontent.com/u/9027134?v=4)](https://github.com/kimtrien "kimtrien (5 commits)")[![NguyenUoc98](https://avatars.githubusercontent.com/u/43318488?v=4)](https://github.com/NguyenUoc98 "NguyenUoc98 (1 commits)")

### Embed Badge

![Health badge](/badges/uocnv-vietnam-zone/health.svg)

```
[![Health](https://phpackages.com/badges/uocnv-vietnam-zone/health.svg)](https://phpackages.com/packages/uocnv-vietnam-zone)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
