ttungbmt / filament-ban
This is my package filament-ban
Installs: 1 090
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 3
Open Issues: 8
Requires
- php: ^8.1
- cybercog/laravel-ban: ^4.7
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-11-11 10:15:32 UTC
README
Introduction
Behind the scenes cybercog/laravel-ban is used.
Installation
You can install the package via composer:
composer require ttungbmt/filament-ban
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-ban-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-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 Nova Resource
Register Ban
and Unban
actions inside your Model's Resource.
public static function table(Table $table): Table { return $table ->prependBulkActions([ \FilamentPro\FilamentBan\Actions\Ban::make('ban'), \FilamentPro\FilamentBan\Actions\Unban::make('unban'), ]); }
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.