Skip to content

Commit 68368e7

Browse files
committed
修改配置文件注释:Laravel 适配器
1 parent c912705 commit 68368e7

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@
55

66
An authorization library that supports access control models like ACL, RBAC, ABAC for webman plugin
77

8-
## Requirements
8+
## 依赖
99

10-
### common
11-
12-
- [PHP-DI](https://github.com/PHP-DI/PHP-DI)
1310
- [ThinkORM](https://www.workerman.net/doc/webman/db/others.html)(默认)
11+
- [PHP-DI](https://github.com/PHP-DI/PHP-DI)
1412
- [illuminate/database](https://www.workerman.net/doc/webman/db/tutorial.html)(可选)
1513

16-
## Installation
14+
## 安装
1715

1816
```sh
1917
composer require casbin/webman-permission
2018
```
2119

22-
## Configure
20+
## 使用
2321

24-
### 1、DI
22+
### 1. 依赖注入配置
2523

26-
configure `config/container.php`Its final content is as follows
24+
修改配置`config/container.php`其最终内容如下
2725

2826
```php
2927
$builder = new \DI\ContainerBuilder();
@@ -32,17 +30,19 @@ $builder->useAutowiring(true);
3230
return $builder->build();
3331
```
3432

35-
### 2、Database configuration
33+
### 2. 数据库配置
34+
35+
> 默认策略存储是使用的ThinkORM,如使用[laravel的数据库](https://learnku.com/docs/laravel/8.x/eloquent/9400)[illuminate/database](https://github.com/illuminate/database),请按照官方文档按照相应的依赖包:https://www.workerman.net/doc/webman/db/tutorial.html
3636
37-
#### (1)模型配置
37+
🚀 **(1) 模型配置**
3838

39-
- 使用ThinkORM(默认)
40-
- 修改数据库 `thinkorm.php` 配置
41-
- 使用laravel数据库(可选)
42-
- 修改数据库 `database.php` 配置
43-
- 修改数据库 `permission.php``adapter`适配器为laravel适配器
39+
- 📒📒📒 使用ThinkORM(默认)
40+
- 修改数据库 `thinkorm.php` 配置
41+
- 📕📕📕 使用laravel数据库(可选)
42+
- 修改数据库 `database.php` 配置
43+
- 修改数据库 `permission.php``adapter`适配器为laravel适配器
4444

45-
#### (2)创建 `casbin_rule` 数据表
45+
🔰 **(2) 创建 `casbin_rule` 数据表**
4646
```sql
4747
CREATE TABLE `casbin_rule` (
4848
`id` BIGINT ( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -64,7 +64,7 @@ CREATE TABLE `casbin_rule` (
6464
) ENGINE = INNODB CHARSET = utf8mb4 COMMENT = '策略规则表';
6565
```
6666

67-
#### (3)配置 `config/redis` 配置
67+
📚 **(3) 配置 `config/redis` 配置**
6868

6969
## 重启webman
7070

src/config/plugin/casbin/webman-permission/permission.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
# Model 设置
1111
'model' => [
1212
'config_type' => 'file',
13-
'config_file_path' => config_path() . '/plugin/casbin/webman-permission/rbac-model.conf',
13+
'config_file_path' => config_path() . 'ugin/casbin/webman-permission/rbac-model.conf',
1414
'config_text' => '',
1515
],
1616
# 适配器
17-
'adapter' => Casbin\WebmanPermission\Adapter\DatabaseAdapter::class,
18-
// 'adapter' => Casbin\WebmanPermission\Adapter\LaravelDatabaseAdapter::class,
17+
'adapter' => Casbin\WebmanPermission\Adapter\DatabaseAdapter::class, // ThinkORM 适配器
18+
// 'adapter' => Casbin\WebmanPermission\Adapter\LaravelDatabaseAdapter::class, // Laravel 适配器
1919
'database' => [
2020
'connection' => '',
2121
'rules_table' => 'casbin_rule',

0 commit comments

Comments
 (0)