PHPackages                             shenstef/qqlbs - 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. shenstef/qqlbs

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

shenstef/qqlbs
==============

腾讯位置服务中国标准行政区划数据 SDK

v1.0.0(6y ago)016MITPHP

Since Jun 17Pushed 6y agoCompare

[ Source](https://github.com/shenstef/qqlbs)[ Packagist](https://packagist.org/packages/shenstef/qqlbs)[ RSS](/packages/shenstef-qqlbs/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

 qqmap-region
==============

[](#-qqmap-region-)

 腾讯位置服务中国标准行政区划数据 SDK.

 [![StyleCI](https://camo.githubusercontent.com/db2fa5f9204271df856d55b458089ed4d877184605fc835f25a7548a6330e1a3/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135363731353231362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/156715216)

安装
--

[](#安装)

```
$ composer require tumobi/qqmap-region -vvv
```

配置
--

[](#配置)

### 创建 key

[](#创建-key)

在使用本扩展之前，你需要去 [腾讯位置服务](https://lbs.qq.com/index.html) 注册账号，在 **key管理** 中创建新密钥。

### 开启 WebServiceAPI

[](#开启-webserviceapi)

找到刚新创建的 key ，点击 **设置** 按钮进入 KEY 设置页面，勾选 WebServiceAPI 后保存。

使用
--

[](#使用)

```
use Tumobi\QQMapRegion\Region;

$key = '你创建的 key';
$region = new Region($key);
```

### 获取全部行政区划数据

[](#获取全部行政区划数据)

```
$result = $region->getAllDistrict();
print_r($result);
```

### 获取子级行政区划

[](#获取子级行政区划)

```
// 北京市
$region_id = 110000;
$result = $region->getChildrenDistrict($region_id);
print_r($result);
```

### 搜索指定关键词的行政区划

[](#搜索指定关键词的行政区划)

```
$keyword = '香格里拉';
$result = $region->searchDistrict($keyword);
print_r($result);
```

### 获取省市区三级选择器行政区划数据

[](#获取省市区三级选择器行政区划数据)

```
$result = $region->getSelectorRegions();
print_r($result);
```

在 Laravel 中使用
-------------

[](#在-laravel-中使用)

安装方式同上，需要添加两处配置，在 config/services.php 加入如下配置

```
'region' => [
    'key' => env('REGION_KEY'),
],
```

在 .env 文件中加入如下配置

```
REGION_KEY=在腾讯位置服务创建的key

```

### 使用方法

[](#使用方法)

```
public function edit(Region $region)
{
    $districts = $region->getAllDistrict();
}
```

或

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

参考
--

[](#参考)

- [行政区划 | 腾讯位置服务](https://lbs.qq.com/webservice_v1/guide-region.html)
- [PHP 扩展包实战教程 - 从入门到发布](https://laravel-china.org/courses/creating-package?rf=23775)

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

2522d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d594eca4ae0ee3a32201716c48bccf5b54d4c17510ab0c3eaa760f4ab35127?d=identicon)[shenstef](/maintainers/shenstef)

---

Top Contributors

[![tumobi](https://avatars.githubusercontent.com/u/28944170?v=4)](https://github.com/tumobi "tumobi (6 commits)")[![shenstef](https://avatars.githubusercontent.com/u/5144202?v=4)](https://github.com/shenstef "shenstef (3 commits)")

### Embed Badge

![Health badge](/badges/shenstef-qqlbs/health.svg)

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

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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