@@ -39,16 +39,12 @@ return $builder->build();
39
39
> 默认策略存储是使用的ThinkORM。
40
40
> 如使用 laravel的数据库 [ illuminate/database] ( https://github.com/illuminate/database ) ,请按照官方文档按照相应的依赖包:https://www.workerman.net/doc/webman/db/tutorial.html
41
41
42
- #### 🚀 (1) 模型配置
42
+ ** 模型配置**
43
43
44
- 使用ThinkORM(默认)
45
- > 修改数据库 ` thinkorm.php ` 配置
44
+ 默认使用ThinkORM。修改数据库 ` thinkorm.php ` 配置
46
45
47
- 使用laravel数据库(可选)
48
- > - 修改数据库 ` database.php ` 配置
49
- > - 修改数据库 ` permission.php ` 的` adapter ` 适配器为laravel适配器
46
+ ** 创建 ` casbin_rule ` 数据表**
50
47
51
- #### 🔰 (2) 创建 ` casbin_rule ` 数据表
52
48
``` sql
53
49
CREATE TABLE `casbin_rule ` (
54
50
` id` BIGINT ( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -70,8 +66,6 @@ CREATE TABLE `casbin_rule` (
70
66
) ENGINE = INNODB CHARSET = utf8mb4 COMMENT = ' 策略规则表' ;
71
67
```
72
68
73
- #### 📚 (3) 配置 ` config/redis ` 配置
74
-
75
69
## 重启webman
76
70
77
71
```
@@ -109,9 +103,9 @@ if (Permission::enforce("eve", "articles", "edit")) {
109
103
}
110
104
```
111
105
112
- 多套配置
106
+ ### 多套配置
113
107
``` php
114
- $permission = Permission::client("other_conf ")
108
+ $permission = Permission::client("restful_conf ")
115
109
// adds permissions to a user
116
110
$permission->addPermissionForUser('eve', 'articles', 'read');
117
111
// adds a role for a user.
@@ -157,4 +151,4 @@ if (is_null(static::$_manager)) {
157
151
}
158
152
```
159
153
耦合太高,不建议这么搞,更多了解:https://www.workerman.net/doc/webman/di.html
160
- </details >
154
+ </details >
0 commit comments