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

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

lysice/laravel-region
=====================

a region package for laravel

1.0(5y ago)2555MITPHP

Since Dec 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Lysice/laravel-region)[ Packagist](https://packagist.org/packages/lysice/laravel-region)[ RSS](/packages/lysice-laravel-region/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Region
======

[](#region)

基于高德开放平台 的PHP 三级联动数据生成器。

安装
--

[](#安装)

```
$ composer require lysice/laravel-region -vvv

```

配置
--

[](#配置)

在使用本扩展之前，你需要去 高德开放平台 注册账号，然后创建应用，获取应用的 API Key。

使用
--

[](#使用)

### 1.发布配置文件与迁移

[](#1发布配置文件与迁移)

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

```

### 2.配置项

[](#2配置项)

config文件里生成的region.php中的配置项一共有四个分别是

- table 标识要生成迁移的表名
- connection 标识要使用的数据库连接配置名,对应database.php中的connections选项中的配置 如设置成mysql 则会使用 config('database.connections.mysql')的配置。
- key 高德开放平台创建应用的key
- prefix 标识要生成的表名前缀

### 3.生成迁移表

[](#3生成迁移表)

```
    php artisan migrate

```

### 4.生成数据 可以使用三种方式

[](#4生成数据-可以使用三种方式)

#### 方法参数注入Region实例生成

[](#方法参数注入region实例生成)

```
    public function region(Region $region)
    {
        $response = $region->region();
    }

```

#### 服务名访问实例方法

[](#服务名访问实例方法)

```
public function edit()
{
    $response = app('region')->region();
}

```

#### 命令行执行

[](#命令行执行)

```
    php artisan region:generate

```

之后在数据库你生成的表结构

参考
--

[](#参考)

高德开放平台接口

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f077a192556cd9c34d866d3a65c0e4ba9d7f3b06403e431f58fd975ac3b7ed9?d=identicon)[Lysice](/maintainers/Lysice)

---

Top Contributors

[![Lysice](https://avatars.githubusercontent.com/u/17869820?v=4)](https://github.com/Lysice "Lysice (6 commits)")

---

Tags

composerlaravelweather

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[vincentbean/laravel-plausible

Laravel Plausible

2556.9k](/packages/vincentbean-laravel-plausible)

PHPackages © 2026

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