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

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

sentiger/laravel-region
=======================

地区模块

1.0(7y ago)114PLpgSQL

Since Apr 1Pushed 7y ago1 watchersCompare

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

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

安装
==

[](#安装)

- 执行安装

`composer require sentiger/region`

- 后期更新

`composer update sentiger/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

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

2600d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f8ad5f505bf1843c0c7aa9b8b1bed119566d3a9188c13788e2e27fc8b165882?d=identicon)[Sentiger](/maintainers/Sentiger)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[spatie/fork

A lightweight solution for running code concurrently in PHP

1.0k2.6M39](/packages/spatie-fork)

PHPackages © 2026

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