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

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

cblink/region
=============

1.0.4(7y ago)15818.1k↓15%32[3 issues](https://github.com/cblink/region/issues)[2 PRs](https://github.com/cblink/region/pulls)MITPHP

Since Apr 2Pushed 5y ago2 watchersCompare

[ Source](https://github.com/cblink/region)[ Packagist](https://packagist.org/packages/cblink/region)[ RSS](/packages/cblink-region/feed)WikiDiscussions master Synced 2d ago

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

region
======

[](#region)

省市区联动数据

安装
--

[](#安装)

`composer require cblink/region`

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

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

```

生成 migration 文件

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

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

执行迁移

`php artisan migrate`

### 默认方法

[](#默认方法)

```
use Cblink\Region\Region;

$region = new Region();

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 94.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 ~38 days

Total

5

Last Release

2859d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravel

### Embed Badge

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

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

###  Alternatives

[slam/phpstan-extensions

Slam extension of phpstan

712.6M81](/packages/slam-phpstan-extensions)

PHPackages © 2026

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