jeffersongoncalves/filament-ban
A Filament plugin for managing user bans from your admin panel. Ban and unban accounts, track reasons and expiry, and integrate bans cleanly into your Laravel app's existing models and workflows.
composer require jeffersongoncalves/filament-ban
php artisan vendor:publish --tag="filament-ban-migrations"
php artisan migrate
Optionally publish config and translations (translations are new in 1.1.0):
php artisan vendor:publish --tag="filament-ban-config"
php artisan vendor:publish --tag="filament-ban-translations"
Then:
HasBans / Bannable) to your User model.->plugin(FilamentBanPlugin::make()).UserResource and attach the provided ban/unban actions to the table.Where to look first: the README for trait/middleware names, src/ for the plugin class and actions, config/ for table/column names, and resources/lang/ for the new locale files. Your first use case should be: ban a test user from the Users table, then confirm that user can no longer reach the panel.
->visible(fn ($record) => $record->isBanned())).canAccessPanel() override — register the middleware in bootstrap/app.php (Laravel 11+) and rely on the model method for panel access so both web and API entry points are covered.banned_at / banned_until and a scheduled command that lifts expired bans; surface the expiry as a DateTimePicker in the action form.after() callback or listen to package events to email the user and write to an audit table (actor_id, reason, expires_at), so bans are explainable later.->locale('de') per panel) and the ban/unban actions, modals, and notifications render in the new locales (ar, az, de, es, fa, fr, hi, it, ja, nl, pl, pt, ru, tr, uk, uz, zh_CN). Publish translations only when you need to override wording.RefreshDatabase, create a banned user, assert the panel returns 403, then assert unbanning restores access.app/Http/Kernel.php; Laravel 11+ uses bootstrap/app.php. A missing registration silently leaves the panel open.->disabled(fn ($record) => $record->is(auth()->user())) so an admin cannot ban themselves out of the panel.zh_CN; if you publish translations, keep the directory names intact and confirm your app's locale string matches, otherwise Filament falls back to English.UserPolicy before assuming the plugin failed.php artisan filament:cache-components / clear config cache — stale component caches are a common "action not showing" cause.How can I help you explore Laravel packages today?