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

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

yiche/region
============

地区模块

1.0(7y ago)013PLpgSQL

Since Apr 9Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

安装
==

[](#安装)

- 执行安装dev分支，稳定版本无需指定 `composer require yiche/region:dev-master`
- 后期更新

`composer update yiche/region`

- 安装项目数据库

`php artisan yiche:region-install`

使用
==

[](#使用)

- 默认安装好之后会有个默认路由`http://xxx/yiche/region/all`，返回一个结构层的json

```
[
    {
        "id": 1,
        "name": "北京市",
        "code": "110000",
        "parent_code": "",
        "level": 1,
        "children": [
            {
                "id": 2,
                "name": "市辖区",
                "code": "110100",
                "parent_code": "110000",
                "level": 2,
                "children": [
                    {
                        "id": 3,
                        "name": "东城区",
                        "code": "110101",
                        "parent_code": "110100",
                        "level": 3,
                        "children": []
                    }
                ]
            }
        ]
    },
    ......
```

- 如果这个结构不满足实际业务返回的数据格式，可以通过接口来自定义,这里是返回所有的数据！

```
Route::get('/', function (\Yiche\Region\Region $region){
   return app('ycRegion')->getAll();
});

```

```
[
    {
        "id": 1,
        "name": "北京市",
        "code": "110000",
        "parent_code": "",
        "level": 1
    },
    {
        "id": 2,
        "name": "市辖区",
        "code": "110100",
        "parent_code": "110000",
        "level": 2
    },
    ...
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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

2593d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3731e6b800b235ddc9340eefe31b741f9abd1885de0fc668e1fc19991de838a?d=identicon)[yiche](/maintainers/yiche)

---

Top Contributors

[![Sentiger](https://avatars.githubusercontent.com/u/6236245?v=4)](https://github.com/Sentiger "Sentiger (12 commits)")

### Embed Badge

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

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

###  Alternatives

[funiq/geophp

Open-source native PHP library for doing geometry operations. Can read and write a wide variety of formats: (E)WKT, (E)WKB, TWKB, GeoJSON, KML, GPX, GeoRSS. Works with all Simple-Feature geometries (Point, LineString, Polygon...) and can be used to get centroids, bounding-boxes, area, etc.

21114.4k1](/packages/funiq-geophp)[moell/rss

moell/rss is a package that follows the RSS 2.0 standard

111.8k1](/packages/moell-rss)

PHPackages © 2026

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