rectitude-open / filament-ban-manager
A Ban Manager for Filament
Requires
- php: ^8.1
- filament/filament: ^3.0
- mchev/banhammer: ^2.4
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^2.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
Filament Ban Manager
Filament Ban Manager is a user-friendly plugin that provides complete ban management (both models and IPs) for your Filament panel, built on top of the Banhammer package.
Installation
You can install the package via composer:
composer require rectitude-open/filament-ban-manager
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-ban-manager-migrations"
php artisan migrate
Note: The migrations from the Banhammer package have been integrated and optimized in this plugin, so you do not need to publish Banhammer's migrations separately.
You can publish the config file with:
php artisan vendor:publish --tag="filament-ban-manager-config"
Optionally, you can publish the config file of the Banhammer package:
php artisan vendor:publish --provider="Mchev\Banhammer\BanhammerServiceProvider" --tag="config"
This is the contents of the published config file:
return [ 'filament_resource' => RectitudeOpen\FilamentBanManager\Resources\BanResource::class, 'model' => RectitudeOpen\FilamentBanManager\Models\Ban::class, 'navigation_sort' => 0, 'navigation_icon' => 'heroicon-o-shield-exclamation', 'datetime_format' => 'Y-m-d H:i:s', ];
Usage
The package provides a Ban resource that allows you to create and delete bans for both models and IP addresses.
To use the resource page provided by this package, you need to register it in your Panel Provider first.
namespace App\Providers\Filament; use RectitudeOpen\FilamentBanManager\FilamentBanManagerPlugin; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentBanManagerPlugin::make() ]); } }
For more advanced ban features, please refer to the documentation of the Banhammer package.
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.