PHPackages                             edwinlll/regionbuilder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. edwinlll/regionbuilder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

edwinlll/regionbuilder
======================

china region table generator

v1.0.0(6y ago)116MITPHP

Since May 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/lvzhihao/RegionBuilder)[ Packagist](https://packagist.org/packages/edwinlll/regionbuilder)[ Docs](https://github.com/lvzhihao/RegionBuilder)[ RSS](/packages/edwinlll-regionbuilder/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

1. Require with Composer
========================

[](#1-require-with-composer)

```
composer require edwinlll/regionbuilder

```

2. Require Laravel
==================

[](#2-require-laravel)

- create Laravel projects:

```
composer global require laravel/installer
laravel new regions

```

3. Example
==========

[](#3-example)

```
php artisan regionbuilder:generate --help

Description:
  生成最新标准地区表，默认表名为regions，表名可通过参数修改

Usage:
  regionbuilder:generate [options] [--] []

Arguments:
  level                        需要生成多少级数据 [default: 3]

Options:
  -t, --tablename[=TABLENAME]  生成的表名 [default: "regions"]
  -f, --force[=FORCE]          强制重新生成 [default: false]
  -h, --help                   Display this help message
  -q, --quiet                  Do not output any message
  -V, --version                Display this application version
      --ansi                   Force ANSI output
      --no-ansi                Disable ANSI output
  -n, --no-interaction         Do not ask any interactive question
      --env[=ENV]              The environment the command should run under
  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

- With tablename:

```
php artisan regionbuilder:generate -t myregionsname

```

- Table schema:

```
Schema::create($tablename, function(Blueprint $table)
{
    $table->increments('id');
    $table->integer('pid')->unsigned()->default(0)->comment('父类自增ID');
    $table->integer('region_grade')->unsigned()->default(0)->comment('地区层级');
    $table->string('name', 30)->comment('名称');
    $table->string('code', 12)->nullable()->comment("行政区代码");
    $table->string('province_code', 2)->nullable()->comment("省份、直辖市、自治区");
    $table->string('city_code', 4)->nullable()->comment("城市");
    $table->string('area_code', 6)->nullable()->comment("区县");
    $table->string('street_code', 9)->nullable()->comment("乡镇、街道");
    $table->timestamps();
    $table->softDeletes();
});

```

- make seeder：

Before exporting, you can modify the table structure and data according to your own requirements

```
composer require orangehill/iseed
php artisan iseed myregionsname

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2544d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39882476?v=4)[edwinlll](/maintainers/edwinlll)[@Edwinlll](https://github.com/Edwinlll)

---

Top Contributors

[![lvzhihao](https://avatars.githubusercontent.com/u/720880?v=4)](https://github.com/lvzhihao "lvzhihao (11 commits)")

### Embed Badge

![Health badge](/badges/edwinlll-regionbuilder/health.svg)

```
[![Health](https://phpackages.com/badges/edwinlll-regionbuilder/health.svg)](https://phpackages.com/packages/edwinlll-regionbuilder)
```

###  Alternatives

[nativephp/electron

Electron wrapper for the NativePHP framework.

519114.4k8](/packages/nativephp-electron)[abdelhamiderrahmouni/filament-monaco-editor

A monaco editor form field for filamentphp.

18182.2k](/packages/abdelhamiderrahmouni-filament-monaco-editor)[hiqdev/yii2-module-pages

Yii2 Pages Module

121.1k](/packages/hiqdev-yii2-module-pages)

PHPackages © 2026

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