Download the PHP package oldfurybird/rabc without Composer
On this page you can find all versions of the php package oldfurybird/rabc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download oldfurybird/rabc
More information about oldfurybird/rabc
Files in oldfurybird/rabc
Download oldfurybird/rabc
More information about oldfurybird/rabc
Files in oldfurybird/rabc
Please rate this library. Is it a good library?
Informations about the package rabc
rabc
基于角色管理权限扩展
require laravel:~5.6
安装
composer require oldfurybird/rabc
或
git clone [email protected]:oldFuryBird/rabc.git vendor/oldfurybird/rabc/
使用
-
注册服务,在 config\app 中
- 默认使用 App\User 模型作为用户模型 可以在config/rabc.php 中修改
- 当用户表migrate成功之后
php artisan rabc:install
允许mirgrate
User 需要implements UserInterface接口
- hasRole()
- roles($role_name)
- can($permission[s]) 能否通过权限测试
- attachRole[s]/detachRole[s] 添加删除角色 通过 use Rabc\RabcUserTrait trait 具体实现
middleware
在Kernel.php 添加中间件 Rabc\Middleware\TrustRole,Rabc\Middleware\TrustPermission
控制路由访问权限等功能
$this->middleware('role:test|test_2'); // test或test_2角色可以访问
$this->middleware('perm:test1');// test1 权限通过的用户可以访问
实例
反馈
如果您有任何建议和意见可以给我issue或者反馈[email protected]
All versions of rabc with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.5.0
illuminate/console Version ~5.0
illuminate/support Version ~5.0
illuminate/cache Version ~5.0
illuminate/console Version ~5.0
illuminate/support Version ~5.0
illuminate/cache Version ~5.0
The package oldfurybird/rabc contains the following files
Loading the files please wait ....