laravel-enso/rolemanager
最新稳定版本:5.6.7
Composer 安装命令:
composer require laravel-enso/rolemanager
包简介
Role management for Laravel Enso
README 文档
README
Description
Roles manages role records and role-to-permission assignment in Laravel Enso.
The package exposes CRUD and table APIs for roles, companion endpoints for reading and writing role permissions, and a sync command used to propagate role configuration between environments.
It is intended for Enso applications that use permission-based route access and need roles managed from the backoffice instead of hard-coded seeds alone.
Installation
Install the package:
composer require laravel-enso/roles
Run the package migrations:
php artisan migrate
Optional publishes:
php artisan vendor:publish --tag=roles-config php artisan vendor:publish --tag=roles-factory php artisan vendor:publish --tag=roles-seeder
Features
- Role CRUD, options, table init, table data, and Excel export endpoints.
- Permission assignment endpoints for reading, setting, and writing role permissions.
- Config publishing for role restrictions and group visibility.
- Default role seeding for
admin,supervisor, andapplication. enso:roles:synccommand for syncing local role definitions fromconfig/local/roles.
Usage
Main route groups:
system.roles.*system.roles.permissions.*
Permission assignment flow:
- read current role permissions through
permissions.get - submit updates through
permissions.set - persist config files through
permissions.write
Environment sync:
php artisan enso:roles:sync
The command only runs when the local config/local/roles directory exists.
Default seeded roles:
adminsupervisorapplication
API
HTTP routes
GET api/system/roles/createPOST api/system/rolesGET api/system/roles/{role}/editPATCH api/system/roles/{role}DELETE api/system/roles/{role}GET api/system/roles/initTableGET api/system/roles/tableDataGET api/system/roles/exportExcelGET api/system/roles/optionsGET api/system/roles/permissions/get/{role}POST api/system/roles/permissions/set/{role}POST api/system/roles/permissions/write/{role}
Artisan commands
enso:roles:sync
Depends On
Required Enso packages:
laravel-enso/core↗laravel-enso/enums↗laravel-enso/forms↗laravel-enso/helpers↗laravel-enso/menus↗laravel-enso/migrator↗laravel-enso/permissions↗laravel-enso/rememberable↗laravel-enso/select↗laravel-enso/tables↗laravel-enso/user-groups↗laravel-enso/users↗
Companion frontend package:
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!
统计信息
- 总下载量: 14.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-19