Download the PHP package mradang/laravel-rbac without Composer
On this page you can find all versions of the php package mradang/laravel-rbac. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-rbac
安装
配置
-
添加 .env 环境变量,使用默认值时可省略
-
刷新数据库迁移
-
用户模型配置
-
路由
需指定路由 name,以「abc.xyz」形式命名,并添加「rbac」中间件
添加的内容
添加的数据表迁移
- rbac_access
- rbac_node
- rbac_role_user
- rbac_role
添加的路由
- post /api/rbac/allNodes
- post /api/rbac/allRoles
- post /api/rbac/createRole
- post /api/rbac/deleteRole
- post /api/rbac/updateRole
- post /api/rbac/findRoleWithNodes
- post /api/rbac/saveRoleSort
- post /api/rbac/syncRoleNodes
添加的命令
-
生成路由描述文件:route_desc.json
- 刷新路由节点及描述
添加的路由中间件
- rbac
路由保护
用户模型 Trait
增加以下内容:
- belongsToMany rbacRoles 角色关联(多对多)
- array getAccessAttribute 权限属性 access,user 模型需实现 getIsAdminAttribute(超级管理员)属性
- void rbacSyncRoles(array $roles) 同步用户与角色的关联,$roles 为角色 id 数组
- void rbacDeleteUser() 删除用户权限信息
签发令牌
验证登录
验证权限
All versions of laravel-rbac with dependencies
PHP Build Version
Package Version
Requires
laravel/framework Version
^9.0 || ^10.0
laravel/sanctum Version ^2.14 || ^3.0
overtrue/laravel-pinyin Version ~5.0
laravel/sanctum Version ^2.14 || ^3.0
overtrue/laravel-pinyin Version ~5.0
The package mradang/laravel-rbac contains the following files
Loading the files please wait ....