aluisio-pires/permissions
最新稳定版本:v0.1.19
Composer 安装命令:
composer require aluisio-pires/permissions
包简介
Permission handling for Laravel 8.0 and up
关键字:
README 文档
README
Requirements:
Features:
- Access control list (ACL) tool / menu
- Roles and Permissions Filament pages
Installation
-
Make sure you have your Laravel Filament installed:
-
Add the package with composer:
composer require pdmfc/filament-permission
Configuration
- Create Files
php artisan filament-permission:create-files
- Run migrations
php artisan migrate
- Now you can add the
hasRolestrait to yourUsermodel to enable the authorization
...
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, HasRoles, Notifiable;
...
- If your
Usermodel has theSoftDeletestrait, you can remove the commented code fromUsersRelationManagerclass to enable the trashed filter.
...
->filters([
Tables\Filters\TrashedFilter::make(),
])
Usage
Add the admin role to your user and access your filament admin panel to see the new Administration navigation group.
Example:
User::factory()->create([ 'name' => 'Test User', 'email' => 'test@example.com', ])->assignRole('admin');
More information
It's recommended to read the Spatie/Laravel-Permission documentation at: https://spatie.be/docs/laravel-permission/v6/introduction
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-27