定制 aluisio-pires/permissions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 hasRoles trait to your User model to enable the authorization
...
class User extends Authenticatable
{
    /** @use HasFactory<\Database\Factories\UserFactory> */
    use HasFactory, HasRoles, Notifiable;
...
  • If your User model has the SoftDeletes trait, you can remove the commented code from UsersRelationManager class 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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-27