emptynick/voyager-permissions
Composer 安装命令:
composer require emptynick/voyager-permissions
包简介
Permission system for Voyager II using spatie/laravel-permission
关键字:
README 文档
README
This plugin for Voyager II implements spaties laravel-permission to authorize actions and users.
Getting started
Require the package
First, require the plugin: composer require emptynick/voyager-permissions.
Run the installer
Run the installer by calling php artisan permissions:install.
Publishing migrations and config file
First the installer will publish a configuration file and migrations.
After that you will be asked if you want to migrate now.
If you want to change the published migrations select No and run the command again after you finished editing.
Add the HasRole Trait to your user model
The the installer will ask you to open your user model and add the trait Emptynick\Permissions\Traits\HasRoles:
<?php namespace App\Models; use Illuminate\Foundation\Auth\User as Authenticatable; use Emptynick\Permissions\Traits\HasRoles; class User extends Authenticatable { use HasRoles; // ... }
Add necessary permissions
In order to be allowed to open the permission manager, the installer will add some required permissions to your user.
Enter your user model (normally \App\Models\User) hit enter and enter the ID of your user.
Thats it! Now you are able to access the Permission page from the menu.
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-01