widiu7omo/filament-bandel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

widiu7omo/filament-bandel

最新稳定版本:v2.0.2

Composer 安装命令:

composer require widiu7omo/filament-bandel

包简介

Banned Model with Filament Bandel

README 文档

README

This code forked from - Truong Thanh Tung Filament Ban

Introduction

We are using laravel-ban by cybercog on the background.

single_ban_user bulk_ban_user

Requirement

  • Laravel 10
  • FilamentPHP

Installation

You can install the package via composer:

composer require widiu7omo/filament-bandel

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-bandel-migrations"
php artisan migrate

ou can publish and run the translations with:

php artisan vendor:publish --tag="filament-bandel-translations"

You can publish the config file from cybercog/laravel-ban with:

php artisan vendor:publish --tag="ban-config"

Prepare Bannable model

use Cog\Contracts\Ban\Bannable as BannableContract;
use Cog\Laravel\Ban\Traits\Bannable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements BannableContract
{
    use Bannable;
}

Prepare bannable model database table

Bannable model must have nullable timestamp column named banned_at. This value used as flag and simplify checks if user was banned. If you are trying to make default Laravel User model to be bannable you can use example below.

Register Ban Actions in Filament Resource

Register BanAction and UnbanAction actions inside your Model's Resource.

    public static function table(Table $table): Table
    {
        return $table
            ->actions([
//                ...rest,
                \Widiu7omo\FilamentBandel\Actions\BanAction::make(),
                \Widiu7omo\FilamentBandel\Actions\UnbanAction::make()
            ]);
    }

Register Bulk Un/Ban Actions in Filament Resource

Register BanBulkAction and UnbanBulkAction actions inside your Model's Resource.

    public static function table(Table $table): Table
    {
        return $table
            ->prependBulkActions([
//            ...rest
                \Widiu7omo\FilamentBandel\Actions\BanBulkAction::make('banned_model'),
                \Widiu7omo\FilamentBandel\Actions\UnbanBulkAction::make('unbanned_model'),
            ]);
    }

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 53.58k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-05