PHPackages                             myischen/region - 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. myischen/region

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

myischen/region
===============

v1.3.1(5y ago)151MITPHP

Since Apr 2Pushed 5y agoCompare

[ Source](https://github.com/myischen/region)[ Packagist](https://packagist.org/packages/myischen/region)[ RSS](/packages/myischen-region/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (10)Used By (0)

region
======

[](#region)

省市区联动数据

安装
--

[](#安装)

`composer require Myischen/region`

在 app.php 中加入服务提供者

```
/*
 * Package Service Providers...
 */
Myischen\Region\RegionServiceProvider::class,

```

生成 migration 文件

`php artisan vendor:publish --provider="Myischen\Region\RegionServiceProvider"`

在 `2018_01_01_000000_create_regions_table.php` 可以根据自身需求与结构修改表名或字段名

执行迁移

`php artisan migrate`

### 默认方法

[](#默认方法)

```
use Myischen\Region\Region;

$region = new Region();

$region->allProvinces(); // 全部省份
$region->allCities(); // 全部城市
$region->allAreas(); // 全部区
$region->allStreets()//所有乡镇
$region->nest($id = null); // 展示全部子区域，可指定某个省或市id
$region->nestFromChild($id); // 根据市或区id展示其所有父结构
$region->nestByCode($code = null); // 展示全部子区域，可指定某个省或市code
$region->nestFromChildByCode($code); // 根据市或区code展示其所有父结构
```

#### Command

[](#command)

Regions Update

```
$ php artisan region:update
```

数据来自

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 65.4% 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 ~117 days

Recently: every ~195 days

Total

9

Last Release

2122d ago

### Community

Maintainers

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

---

Top Contributors

[![Hanson](https://avatars.githubusercontent.com/u/10583423?v=4)](https://github.com/Hanson "Hanson (17 commits)")[![myischen](https://avatars.githubusercontent.com/u/29190298?v=4)](https://github.com/myischen "myischen (8 commits)")[![mingyoung](https://avatars.githubusercontent.com/u/6228858?v=4)](https://github.com/mingyoung "mingyoung (1 commits)")

### Embed Badge

![Health badge](/badges/myischen-region/health.svg)

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

###  Alternatives

[topthink/think-captcha

captcha package for thinkphp

117982.4k78](/packages/topthink-think-captcha)

PHPackages © 2026

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