farmit/rrrbac-for-laravel
最新稳定版本:v1.0.12
Composer 安装命令:
composer require farmit/rrrbac-for-laravel
包简介
Role, routes, rules, based access control.
README 文档
README
Role, routes, rules, based access control.
In order to install the package, execute the following command:
composer require farmit/rrrbac-for-laravel
Create a Rules directory inside app directory
Add \Farmit\RrrbacForLaravel\Providers\RrrbacServiceProvider::class to the list of providers in config/app.php.
If you haven't already, publish Spatie Permission's vendor running php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
and add HasRoles trait to User model.
Change in config/permission.php
Spatie\Permission\Models\Role::class with \Farmit\RrrbacForLaravel\Models\Role::class
Spatie\Permission\Models\Permission::class with \Farmit\RrrbacForLaravel\Models\Permission::class
Then publish RRRBac vendor running php artisan vendor:publish --provider="Farmit\RrrbacForLaravel\Providers\RrrbacServiceProvider"
Run php artisan migrate
Run the following command to install the Filament assets:
php artisan filament:install --tables --forms --notifications --infolists
After defining roles and users that have access to the RRRbac control panel,
add \Farmit\RrrbacForLaravel\Http\Middleware\RoutesPermission::class to the 'web' middleware group
To extend permission to Livewire add \Farmit\RrrbacForLaravel\Livewire\Trait\CanView trait to components
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-16