PHPackages                             lianglong/hyperf-tenancy - 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. [Framework](/categories/framework)
4. /
5. lianglong/hyperf-tenancy

ActiveLibrary[Framework](/categories/framework)

lianglong/hyperf-tenancy
========================

Automatic multi-tenancy for your Hyperf application.

v1.0.2(4y ago)213[1 issues](https://github.com/lianglong/hyperf-tenancy/issues)MITPHPPHP &gt;=7.3

Since Dec 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lianglong/hyperf-tenancy)[ Packagist](https://packagist.org/packages/lianglong/hyperf-tenancy)[ RSS](/packages/lianglong-hyperf-tenancy/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (3)Dependencies (12)Versions (4)Used By (0)

hyperf-tenancy
==============

[](#hyperf-tenancy)

来自于laravel的优秀library  ，将其移植到hyperf。

- 当前项目基于 stancl/tenancy:v3.4.5
- 项目依赖 [limingxinleo/i-cache](https://github.com/limingxinleo/i-cache) (来自laravel的illuminate/cache)。
- 由于精力有限，所有commands仅是针对继承关系简单做代码修改，尚未测试。有需求的同学欢迎完善后进行pr。
- 目前仅适配基于RequestData以及Path两种方式的解析器，Domain尚未测试(似乎hyperf集成的nikic/fast-route也没提供子域名相关功能)

##### 文档 [https://tenancyforlaravel.com/docs/v3](https://tenancyforlaravel.com/docs/v3/)

[](#文档-httpstenancyforlaravelcomdocsv3)

### 安装

[](#安装)

```
    # composer require lianglong/hyperf-tenancy
    # php bin/hyperf.php tenants:install

```

### 配置

[](#配置)

因为需要启用缓存tags，需要将 config/autoload/i\_cache.php 中default默认缓存改为redis

> 建议新建监听器针对中间件进行初始化

```
