PHPackages                             plugins-world/dcat-saas - 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. plugins-world/dcat-saas

ActiveLibrary

plugins-world/dcat-saas
=======================

DcatSaas plugin for the laravel and dcat-saas

562PHP

Since May 13Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/plugins-world/DcatSaas)[ Packagist](https://packagist.org/packages/plugins-world/dcat-saas)[ RSS](/packages/plugins-world-dcat-saas/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DcatSaaS
========

[](#dcatsaas)

[![Latest Stable Version](https://camo.githubusercontent.com/82f1b4d0664f5a9699f32e48bff85682655b7c33abf29abd8311b948867b02b6/687474703a2f2f706f7365722e707567782e6f72672f706c7567696e732d776f726c642f646361742d736161732f76)](https://packagist.org/packages/plugins-world/dcat-saas)[![Total Downloads](https://camo.githubusercontent.com/6d78e35e6dee8f16868eca940d446b57ff775e2a1dbe8d97c0ca3ebed316a913/687474703a2f2f706f7365722e707567782e6f72672f706c7567696e732d776f726c642f646361742d736161732f646f776e6c6f616473)](https://packagist.org/packages/plugins-world/dcat-saas)[![Latest Unstable Version](https://camo.githubusercontent.com/64274220d5ca5e8a223cbd314166664d1e093ea33c4972e17c19ac2fe316e235/687474703a2f2f706f7365722e707567782e6f72672f706c7567696e732d776f726c642f646361742d736161732f762f756e737461626c65)](https://packagist.org/packages/plugins-world/dcat-saas) [![License](https://camo.githubusercontent.com/7b974fe6d0541fb8dc98ee98389d3817624776e698b01591c01d69ce1cf97cf7/687474703a2f2f706f7365722e707567782e6f72672f706c7567696e732d776f726c642f646361742d736161732f6c6963656e7365)](https://packagist.org/packages/plugins-world/dcat-saas)[![PHP Version Require](https://camo.githubusercontent.com/f551a56e880963ff0f9900fb0181d8598ed0d46f48d2af05362972b52b701d93/687474703a2f2f706f7365722e707567782e6f72672f706c7567696e732d776f726c642f646361742d736161732f726571756972652f706870)](https://packagist.org/packages/plugins-world/dcat-saas)

一款帮助你在 30 分钟内从 0 搭建 Laravel SaaS 化项目的插件

在`插件管理器`与`应用市场管理器`的插件架构设计下，采用`Tenancy 3.x`、`Dcat-Admin`、`Laravel` 可快速建立属于你的 SaaS 业务框架。

初期可采用 `Dcat-Admin` 完成中心应用开账号，租户应用建立业务逻辑的方案。研发到一定阶段后，推荐采用 [arco.design](https://arco.design/) 或其他你喜欢的管理后台框架，将项目前后端进行分离。

依赖项目：

- [插件管理器 fresns/plugin-manager](http://gitee.com/fresns/plugin-manager)
- [应用市场管理器 fresns/market-manager](https://gitee.com/fresns/market-manager)
- [Tenancy 3.x](https://tenancyforlaravel.com/)
- [Dcat-Admin](http://www.dcatadmin.com/)
- [Laravel](https://laravel.com/)

关注代码仓库
------

[](#关注代码仓库)

项目自动拆分，如需跟踪源码更新情况，请前往： 查看 DcatSaas 目录

[点击前往](https://github.com/plugins-world/plugins)

推荐使用不含 dcat-admin 依赖的 [LaravelSaas](https://github.com/plugins-world/plugins/tree/master/LaravelSaas)

前置要求
----

[](#前置要求)

- Laravel 9+
- Tenancy 3+
- fresns/plugin-manager ^2
- fresns/market-manager ^1
- fresns/cmd-word-manager ^1
- 项目已完成 fresns/plugin-manager、fresns/market-manager 的安装。点击查看[如何安装插件管理器与应用市场管理器？](https://discuss.plugins-world.cn/post/hYJORaBi)

安装
--

[](#安装)

1. 修改扩展包稳定性限制 `composer.json` 需要允许安装稳定性为 `dev` 的依赖包。相关设置见下方代码。

```
{
    ...
    "minimum-stability": "dev",
    "prefer-stable": true,
    ...
}
```

2. 初始化

```
# 创建新项目 saas-test
composer create-project --prefer-dist laravel/laravel saas-test
# 进入项目目录
cd saas-test
# 初始化 git 仓库
git init
git add .
git commit -m "feat: Init."
# 配置应用市场管理器与插件管理器的安装源
composer config repositories.market-manager vcs https://gitee.com/fresns/market-manager
composer config repositories.plugin-manager vcs https://gitee.com/fresns/plugin-manager
# 安装应用市场管理器与插件管理器
composer require fresns/market-manager:dev-master
composer require fresns/plugin-manager:2.x-dev
# 配置数据库与项目信息
	APP_NAME
	APP_URL
	ADMIN_HTTPS

	DB_HOST
	DB_DATABASE
	DB_USERNAME
	DB_PASSWORD
# 执行迁移，增加 plugins 表
php artisan migrate
# 提交仓库变动。方便查看 saas 初始化的文件
git add .
git commit -m "feat: Install market-manager and plugin-manager."
# 从 github 下载 dcat-saas 扩展
php artisan market:require plugins-world/dcat-saas
# 或从 zip 压缩包安装 dcat-saas
php artisan market:require ~/dcat-saas.zip
# 激活插件
php artisan plugin:activate DcatSaas
# 初始化 saas 信息
php artisan saas:install
```

3. 使用

```
# 常用命令
php artisan saas                                # 查看 saas 扩展包提供的命令
php artisan saas:install                        # 初始化 saas（会提示是否覆盖）
php artisan saas:tenant-add                     # 添加租户 可指定租户名，默认 foo
php artisan saas:tenant-del                     # 删除租户 可指定租户名，默认 foo
php artisan saas:tenant-list                    # 当前 saas 列表
php artisan saas:menu-export                    # 导出菜单（默认会尝试导出 foo 租户多菜单）
php artisan saas:menu-reset                     # 重置菜单 (根据导出的菜单进行租户菜单重置)
php artisan tenants:migrate --tenants foo       # 执行 foo 租户的迁移，开发阶段建议指定租户，部署阶段可不指定，以批量运行租户迁移
php artisan tenants:rollback --tenants foo      # 回滚 foo 租户的迁移，开发阶段建议指定租户，部署阶段可不指定，以批量运行租户迁移的回滚操作
# 其他命令自行查看
...

```

前后端分离的部署示例
----------

[](#前后端分离的部署示例)

宝塔缓存与前端代理的配置示例：

搭配 `flow.aliyun.com` 或宝塔 `webhook` 可完成项目的 `devops` 自动化部署。

```
# scui
location ~* ^/(dashboard|tenants-assets|img|config|pc) {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://localhost:3000;
    # proxy_pass http://192.168.0.34:3000;
    # proxy_pass http://xxx.hecs.example.com;
    # proxy_pass https://xxx-xxx-dashboard.oss-cn-shenzhen.aliyuncs.com;
}

# scui
location ~* ^/(dashboard|tenants-assets|img|config|pc) {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass https://xxx-dashboard-aone.oss-cn-shenzhen.aliyuncs.com;
}

# scui
location ~* ^/(platform|platform-assets|img|config) {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass https://xxx-dashboard-platform.oss-cn-shenzhen.aliyuncs.com;
}

# 有缓存的配置
location ~* ^/assets {
    proxy_cache cache_one;
    proxy_cache_key $host$uri$is_args$args;
    add_header Nginx-Cache "$upstream_cache_status";
    proxy_cache_valid 200 304 1m;
    proxy_cache_valid 404 500 502 503 504 1m;
    proxy_cache_valid any 1s;
    expires 1s;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://test-csim-dashboard.oss.iwnweb.com;
}

```

协议
--

[](#协议)

[Apache 2.0](https://github.com/plugins-world/dcat-saas/blob/master/LICENSE)

开发者交流群
------

[](#开发者交流群)

[技术交流群](https://qm.qq.com/cgi-bin/qm/qr?k=JdZJTPzOEsDo3gCR1ENENRXqWPmM-67l&jump_from=webapi&authKey=5EZ6xwqKptmf3U3QMT/IkclubXceZt2JWqkiQbfwXiELv2d4roHTMX32MmBWoi4q) ID: 305795002

原文链接：

-
-

效果图
---

[](#效果图)

[![DcatSaaS 一款帮助你在 30 分钟内从 0 搭建 Laravel SaaS 化项目的插件](https://camo.githubusercontent.com/b0d5da5b03c50eadcceb8cf2a8b1a68cf26abd13830e90035a849dfa0f9cfc98/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f4a6e426554424e7536342e6a7067216c61726765)](https://camo.githubusercontent.com/b0d5da5b03c50eadcceb8cf2a8b1a68cf26abd13830e90035a849dfa0f9cfc98/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f4a6e426554424e7536342e6a7067216c61726765)

[![DcatSaaS 一款帮助你在 30 分钟内从 0 搭建 Laravel SaaS 化项目的插件](https://camo.githubusercontent.com/309c765311cc7ed796bc82594cb11bc823c21ad15d82ff1f3b66b3bda0c7732e/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f6d32617232554c7533562e6a7067216c61726765)](https://camo.githubusercontent.com/309c765311cc7ed796bc82594cb11bc823c21ad15d82ff1f3b66b3bda0c7732e/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f6d32617232554c7533562e6a7067216c61726765)

[![DcatSaaS 一款帮助你在 30 分钟内从 0 搭建 Laravel SaaS 化项目的插件](https://camo.githubusercontent.com/da01a196a185eb9a2867a8842427bf30898edfd3c5c9dcc257fb12fefffb97e0/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f6c4157536d62724457522e706e67216c61726765)](https://camo.githubusercontent.com/da01a196a185eb9a2867a8842427bf30898edfd3c5c9dcc257fb12fefffb97e0/68747470733a2f2f63646e2e6c6561726e6b752e636f6d2f75706c6f6164732f696d616765732f3230323330322f31362f363332342f6c4157536d62724457522e706e67216c61726765)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![mouyong](https://avatars.githubusercontent.com/u/10336437?v=4)](https://github.com/mouyong "mouyong (1 commits)")

### Embed Badge

![Health badge](/badges/plugins-world-dcat-saas/health.svg)

```
[![Health](https://phpackages.com/badges/plugins-world-dcat-saas/health.svg)](https://phpackages.com/packages/plugins-world-dcat-saas)
```

PHPackages © 2026

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