|
1 | 1 |
|
2 | 2 | <div align="center"> |
3 | | - <img src="resources/dist/images/logo-rectangle.png" height="80"> |
| 3 | + <img src="resources/dist/images/logo-rectangle.png" height="80"> |
4 | 4 | </div> |
5 | 5 | <br> |
6 | 6 |
|
7 | 7 | <p align="center"> |
8 | | - <a href="https://packagist.org/packages/printnow/laravel-admin" ><img src="https://poser.pugx.org/printnow/laravel-admin/v/stable" /></a> |
9 | | - <a href="https://packagist.org/packages/printnow/laravel-admin"><img src="https://img.shields.io/packagist/dt/printnow/laravel-admin.svg?color=" /></a> |
10 | | - <a><img src="https://img.shields.io/badge/php-8.1+-59a9f8.svg?style=flat" /></a> |
11 | | - <a><img src="https://img.shields.io/badge/laravel-10+-59a9f8.svg?style=flat" ></a> |
| 8 | + <a href="https://packagist.org/packages/printnow/laravel-admin"><img src="https://poser.pugx.org/printnow/laravel-admin/v/stable" /></a> |
| 9 | + <a href="https://packagist.org/packages/printnow/laravel-admin"><img src="https://img.shields.io/packagist/dt/printnow/laravel-admin.svg" /></a> |
| 10 | + <a href="https://packagist.org/packages/printnow/laravel-admin"><img src="https://img.shields.io/packagist/v/printnow/laravel-admin.svg" /></a> |
| 11 | + <img src="https://img.shields.io/badge/PHP-8.1~8.5-59a9f8.svg?style=flat" /> |
| 12 | + <img src="https://img.shields.io/badge/Laravel-10~13-59a9f8.svg?style=flat" /> |
12 | 13 | </p> |
13 | 14 |
|
14 | | -由于原项目([jqhph/dcat-admin](https://github.com/jqhph/dcat-admin))已停止维护,故基于原作者的项目进行二次开发,修复了部分问题,并添加了更多功能。 |
| 15 | +[jqhph/dcat-admin](https://github.com/jqhph/dcat-admin) 的永久维护 fork。原项目已停止维护,本项目持续跟进 Laravel / PHP 新版本兼容、安全修复和功能增强。 |
15 | 16 |
|
16 | | -新增功能如下: |
| 17 | +## 兼容性 |
17 | 18 |
|
18 | | -> 更多功能正在持续开发... 欢迎交流评论 |
| 19 | +| | Laravel 10 | Laravel 11 | Laravel 12 | Laravel 13 | |
| 20 | +|---|:---:|:---:|:---:|:---:| |
| 21 | +| PHP 8.1 | ✅ | ✅ | ✅ | ✅ | |
| 22 | +| PHP 8.2 | ✅ | ✅ | ✅ | ✅ | |
| 23 | +| PHP 8.3 | ✅ | ✅ | ✅ | ✅ | |
| 24 | +| PHP 8.4 | ✅ | ✅ | ✅ | ✅ | |
| 25 | +| PHP 8.5 | ✅ | ✅ | ✅ | ✅ | |
19 | 26 |
|
20 | | -- 支持通过 `admin.assets_version` 配置项(或 `ADMIN_ASSETS_VERSION` 环境变量)自定义 JS/CSS 缓存破坏版本号,不再强制跟随框架版本 |
21 | | -- [2025/08/05 增强对枚举字段的渲染支持](https://github.com/PrintNow/dcat-admin/pull/5) |
22 | | -- [@deflinhec : 修正 Grid 以 LazyRenderable 呈現時Group Filter 沒有正確篩選](https://github.com/PrintNow/dcat-admin/commit/4390a8f494c20910828e7c93513d13032f0d01dd) |
23 | | -- [新增 highlightjs 类以支持代码块高亮显示](https://github.com/PrintNow/dcat-admin/commit/52050882eea475b9d3863ace98048404f7d320b7) |
24 | | -- [新增 Viewable 类以支持点击眼睛图标展示隐藏值](https://github.com/PrintNow/dcat-admin/commit/c823a4ee04b808e4c12b7ee5468fecda855d0752) |
25 | | -- [支持 `.5` 列宽展示,如 `col-sm-1.5` 等](https://github.com/PrintNow/dcat-admin/commit/87679261725e1b05c4f6f9e9039d3a6f2d29e604) |
26 | | -- [优化对枚举类型的支持](https://github.com/PrintNow/dcat-admin/commit/7e67e59e1e29302546b5967766e814724fe65e84) |
27 | | -- [优化对 https 站点支持](https://github.com/PrintNow/dcat-admin/commit/c1227a2593f05e5210dd79e5761ac8a6246c83b4) |
28 | | -- [最低 PHP 版本调整为 8.1,并支持 8.4](https://github.com/PrintNow/dcat-admin/commit/70886e3f950ff28e1fe0d104b88a254e58125178) |
29 | | -- [支持 Laravel 12](https://github.com/PrintNow/dcat-admin/commit/062601e6bca6ebc9c3bcc68dbb4c8ed3e1328275) |
| 27 | +## 安装 |
30 | 28 |
|
31 | | -> [!IMPORTANT] |
32 | | -> 免责声明: |
33 | | -> 尽管我已在**实际生产项目**中使用过该项目,但我无法保证所做的修改和调整绝对无误。因此,在将其应用于你的生产项目环境时,请务必保持谨慎,充分测试后再使用。 |
34 | | -> |
35 | | -> 安装方法: |
36 | | -> `composer require printnow/laravel-admin:@dev` |
37 | | -
|
38 | | ---- |
39 | | - |
40 | | -> [!NOTE] |
41 | | -> 以下内容是原 repo README.md 介绍并作出了微调 |
42 | | -
|
43 | | -<p align=""><code>Dcat Admin</code>是一个基于<a href="https://www.laravel-admin.org/" target="_blank">laravel-admin</a>二次开发而成的后台系统构建工具,只需很少的代码即可快速构建出一个功能完善的高颜值后台系统。内置丰富的后台常用组件,开箱即用,让开发者告别冗杂的HTML代码,对后端开发者非常友好。</p> |
44 | | - |
45 | | - |
46 | | -- [官方网站](http://www.dcatadmin.com) |
47 | | -- [中文文档](https://learnku.com/docs/dcat-admin) |
48 | | -- [English documentions](http://www.dcatadmin.com/docs/en-2.x/quick-start.html) |
49 | | -- [Demo / 在线演示](http://103.39.211.179:8080/admin) |
50 | | -- [Demo源码](https://github.com/jqhph/dcat-admin-demo) |
51 | | -- [Demo源码 (码云)](https://gitee.com/jqhph/dcat-admin-demo) |
52 | | -- [扩展](#) |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | -### 功能特性 |
59 | | - |
60 | | -- [x] 简洁优雅、灵活可扩展的API |
61 | | -- [x] 用户管理 |
62 | | -- [x] RBAC权限管理,支持无限极权限节点 |
63 | | -- [x] 菜单管理 |
64 | | -- [x] 使用pjax构建无刷新页面,支持**按需加载**静态资源,可以无限扩展组件而不影响整体性能 |
65 | | -- [x] 松耦合的页面构建与数据操作设计,可轻松切换数据源 |
66 | | -- [x] 自定义页面 |
67 | | -- [x] 自定义主题配色 |
68 | | -- [x] 多主题切换功能,内置多种主题色 |
69 | | -- [x] 可轻松构建无菜单栏的独立页面(如可用于构建弹窗选择器等功能) |
70 | | -- [x] 插件功能 |
71 | | -- [x] 可视化代码生成器,可根据数据表一键生成增删改查页面 |
72 | | -- [x] 数据表格构建工具,内置丰富的表格常用功能(如组合表头、数据导出、搜索、快捷创建、批量操作等) |
73 | | -- [x] 树状表格功能构建工具,支持分页和点击加载 |
74 | | -- [x] 数据表单构建工具,内置丰富的表单类型,支持表单异步提交 |
75 | | -- [x] 分步表单构建工具 |
76 | | -- [x] 弹窗表单构建工具 |
77 | | -- [x] 数据详情页构建工具 |
78 | | -- [x] 无限层级树状页面构建工具,支持用拖拽的方式实现数据的层级、排序等操作 |
79 | | -- [x] 内置丰富的常用页面组件(如图表、数据统计卡片、下拉菜单、Tab卡片、提示工具等) |
80 | | -- [x] `Section`功能(类似`Wordpress`的`Filter`和`blade`模板的`section`标签) |
81 | | -- [x] 异步文件上传表单,支持分块多线程上传 |
82 | | -- [x] 多应用 |
83 | | -- [ ] 插件市场,只需在管理页面轻轻点击鼠标即可完成插件的安装、更新和卸载等操作 |
84 | | - |
85 | | - |
86 | | -### 环境 |
87 | | - - PHP >= 7.1.0 |
88 | | - - Laravel 5.5.0 ~ 9.* |
89 | | - - Fileinfo PHP Extension |
90 | | - |
91 | | -### 安装 |
92 | | - |
93 | | -首先需要安装`laravel`框架,如已安装可以跳过此步骤。如果您是第一次使用`laravel`,请务必先阅读文档 [安装 《Laravel中文文档》](https://learnku.com/docs/laravel/8.x/installation/9354) ! |
94 | 29 | ```bash |
95 | | -composer create-project --prefer-dist laravel/laravel 项目名称 9.* |
96 | | -# 或 |
97 | | -composer create-project --prefer-dist laravel/laravel 项目名称 |
98 | | -``` |
99 | | - |
100 | | -安装完`laravel`之后需要修改`.env`文件,设置数据库连接设置正确 |
101 | | - |
102 | | -```dotenv |
103 | | -DB_CONNECTION=mysql |
104 | | -DB_HOST=127.0.0.1 |
105 | | -DB_PORT=3306 |
106 | | -DB_DATABASE=dcat-admin |
107 | | -DB_USERNAME=root |
108 | | -DB_PASSWORD= |
109 | | -``` |
110 | | - |
111 | | -安装`dcat-admin` |
112 | | - |
113 | | - |
114 | | -``` |
115 | | -cd {项目名称} |
116 | | -
|
117 | 30 | composer require printnow/laravel-admin |
118 | 31 | ``` |
119 | 32 |
|
120 | | -然后运行下面的命令来发布资源: |
| 33 | +发布资源并完成安装: |
121 | 34 |
|
122 | | -``` |
| 35 | +```bash |
123 | 36 | php artisan admin:publish |
124 | | -``` |
125 | | - |
126 | | -在该命令会生成配置文件`config/admin.php`,可以在里面修改安装的地址、数据库连接、以及表名,建议都是用默认配置不修改。 |
127 | | - |
128 | | -然后运行下面的命令完成安装: |
129 | | - |
130 | | -> 执行这一步命令可能会报以下错误`Specified key was too long ... 767 bytes`,如果出现这个报错,请在`app/Providers/AppServiceProvider.php`文件的`boot`方法中加上代码`\Schema::defaultStringLength(191);`,然后删除掉数据库中的所有数据表,再重新运行一遍`php artisan admin:install`命令即可。 |
131 | | -
|
132 | | -``` |
133 | 37 | php artisan admin:install |
134 | 38 | ``` |
135 | 39 |
|
136 | | -上述步骤操作完成之后就可以配置`web`服务了,**注意需要把`web`目录指向`public`目录**!如果用的是`nginx`,还需要在配置中加上伪静态配置 |
137 | | -```dotenv |
138 | | -location / { |
139 | | - try_files $uri $uri/ /index.php?$query_string; |
140 | | -} |
141 | | -``` |
142 | | - |
143 | | -启动服务后,在浏览器打开 `http://localhost/admin`,使用用户名 `admin` 和密码 `admin`登陆。 |
| 40 | +## 相较原项目的改动 |
144 | 41 |
|
| 42 | +### 兼容性修复 |
145 | 43 |
|
146 | | -<a name="extensions"></a> |
147 | | -### 扩展 |
| 44 | +- **Laravel 13**:修复 `redirect()->with()` 将 `MessageBag` 序列化为数组导致视图报错的问题,引入 `SessionMessage` 值对象替代,兼容 PHP session JSON / PHP 两种序列化模式 |
| 45 | +- **Laravel 12**:新增支持 |
| 46 | +- **PHP 8.4 / 8.5**:修复隐式 nullable 参数声明等兼容性问题,最低 PHP 版本提升至 8.1 |
148 | 47 |
|
149 | | -| 扩展 | 描述 | dcat-admin 版本 | |
150 | | -| ------------------------------------------------ | ---------------------------------------- |---------------------------------------- | |
151 | | -| [mosiboom/dcat-iframe-tab](https://github.com/mosiboom/dcat-iframe-tab) | IFRAME TAB标签切换 | 2.x | |
152 | | -| [super-eggs/dcat-distpicker](https://github.com/super-eggs/dcat-distpicker) | 省市区联动 | 2.x | |
153 | | -| [ueditor](https://github.com/jqhph/dcat-admin-ueditor) | 百度在线编辑器 | 1.x | |
154 | | -| [grid-sortable](https://github.com/jqhph/dcat-admin-grid-sortable) | 表格拖曳排序工具 | 1.x | |
| 48 | +### 安全修复 |
155 | 49 |
|
| 50 | +- `toastr` 消息输出改用 `json_encode()`,防止单引号 / 反斜杠破坏 JS 语法及潜在 XSS |
156 | 51 |
|
157 | | -### 鸣谢 |
158 | | -`Dcat Admin` 基于以下组件: |
| 52 | +### 功能增强 |
159 | 53 |
|
160 | | -+ [Laravel](https://laravel.com/) |
161 | | -+ [Laravel Admin](https://www.laravel-admin.org/) |
162 | | -+ [AdminLTE3](https://github.com/ColorlibHQ/AdminLTE) |
163 | | -+ [bootstrap4](https://getbootstrap.com/) |
164 | | -+ [jQuery3](https://jquery.com/) |
165 | | -+ [Eonasdan Datetimepicker](https://github.com/Eonasdan/bootstrap-datetimepicker/) |
166 | | -+ [font-awesome](http://fontawesome.io) |
167 | | -+ [jquery-form](https://github.com/jquery-form/form) |
168 | | -+ [moment](http://momentjs.com/) |
169 | | -+ [webuploader](http://fex.baidu.com/webuploader/) |
170 | | -+ [jquery-pjax](https://github.com/defunkt/jquery-pjax) |
171 | | -+ [Nestable](http://dbushell.github.io/Nestable/) |
172 | | -+ [toastr](http://codeseven.github.io/toastr/) |
173 | | -+ [editor-md](https://github.com/pandao/editor.md) |
174 | | -+ [fontawesome-iconpicker](https://github.com/itsjavi/fontawesome-iconpicker) |
175 | | -+ [layer弹出层](http://layer.layui.com/) |
176 | | -+ [char.js](https://www.chartjs.org) |
177 | | -+ [nprogress](https://ricostacruz.com/nprogress/) |
178 | | -+ [bootstrap-validator](https://github.com/1000hz/bootstrap-validator) |
179 | | -+ [Google map](https://www.google.com/maps) |
180 | | -+ [Tencent map](http://lbs.qq.com/) |
| 54 | +- 支持通过 `admin.assets_version` 配置项(或 `ADMIN_ASSETS_VERSION` 环境变量)独立控制 JS/CSS 缓存版本号,不再强制跟随框架版本 |
| 55 | +- 新增 `Viewable` 列展示类,支持点击眼睛图标切换显示 / 隐藏值 |
| 56 | +- 新增 `HighlightJs` 组件,支持代码块语法高亮 |
| 57 | +- 增强枚举(`BackedEnum`)字段的渲染支持 |
| 58 | +- 支持 `.5` 列宽,如 `col-sm-1.5` |
| 59 | +- 优化 HTTPS 站点的资源 URL 生成 |
181 | 60 |
|
182 | | -### Contributors |
| 61 | +### Bug 修复 |
183 | 62 |
|
184 | | -#### Code Contributors |
| 63 | +- 修复 Grid 以 `LazyRenderable` 渲染时 Group Filter 筛选不生效的问题([@deflinhec](https://github.com/PrintNow/dcat-admin/commit/4390a8f494c20910828e7c93513d13032f0d01dd)) |
185 | 64 |
|
186 | | -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. |
187 | | -<a href="https://github.com/jqhph/dcat-admin/graphs/contributors"><img src="https://opencollective.com/dcat-admin/contributors.svg?width=890&button=false" /></a> |
| 65 | +## 文档 |
188 | 66 |
|
189 | | -### Financial Contributors |
| 67 | +功能用法与原项目一致,参考原项目文档: |
190 | 68 |
|
191 | | -Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/dcat-admin/contribute)] |
192 | | - |
193 | | -#### Individuals |
194 | | - |
195 | | -<a href="https://opencollective.com/dcat-admin"><img src="https://opencollective.com/dcat-admin/individuals.svg?width=890"></a> |
| 69 | +- [中文文档](https://learnku.com/docs/dcat-admin) |
| 70 | +- [English documentation](http://www.dcatadmin.com/docs/en-2.x/quick-start.html) |
| 71 | +- [原项目 README(功能特性、扩展、鸣谢)](README.origin.md) |
196 | 72 |
|
197 | | -#### Organizations |
| 73 | +## 免责声明 |
198 | 74 |
|
199 | | -Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/dcat-admin/contribute)] |
| 75 | +本项目已在实际生产环境使用,但无法保证所有修改绝对无误,上线前请充分测试。 |
200 | 76 |
|
201 | | -<a href="https://opencollective.com/dcat-admin/organization/0/website"><img src="https://opencollective.com/dcat-admin/organization/0/avatar.svg"></a> |
202 | | -<a href="https://opencollective.com/dcat-admin/organization/1/website"><img src="https://opencollective.com/dcat-admin/organization/1/avatar.svg"></a> |
203 | | -<a href="https://opencollective.com/dcat-admin/organization/2/website"><img src="https://opencollective.com/dcat-admin/organization/2/avatar.svg"></a> |
204 | | -<a href="https://opencollective.com/dcat-admin/organization/3/website"><img src="https://opencollective.com/dcat-admin/organization/3/avatar.svg"></a> |
205 | | -<a href="https://opencollective.com/dcat-admin/organization/4/website"><img src="https://opencollective.com/dcat-admin/organization/4/avatar.svg"></a> |
206 | | -<a href="https://opencollective.com/dcat-admin/organization/5/website"><img src="https://opencollective.com/dcat-admin/organization/5/avatar.svg"></a> |
207 | | -<a href="https://opencollective.com/dcat-admin/organization/6/website"><img src="https://opencollective.com/dcat-admin/organization/6/avatar.svg"></a> |
208 | | -<a href="https://opencollective.com/dcat-admin/organization/7/website"><img src="https://opencollective.com/dcat-admin/organization/7/avatar.svg"></a> |
209 | | -<a href="https://opencollective.com/dcat-admin/organization/8/website"><img src="https://opencollective.com/dcat-admin/organization/8/avatar.svg"></a> |
210 | | -<a href="https://opencollective.com/dcat-admin/organization/9/website"><img src="https://opencollective.com/dcat-admin/organization/9/avatar.svg"></a> |
| 77 | +## License |
211 | 78 |
|
212 | | -### License |
213 | | ------------- |
214 | | -`dcat-admin` is licensed under [The MIT License (MIT)](LICENSE). |
| 79 | +[MIT](LICENSE) |
0 commit comments