Ban plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Ban by Jefferson Gonçalves

Community

Ban and unban any Eloquent model directly from your Filament panel. This package wraps cybercog/laravel-ban and ships ready-to-use actions, bulk actions, an icon column and a status filter for your Filament resources and tables. Inspired by cybercog/laravel-nova-ban.

Tags: Action
Supported versions:
5.x 4.x 3.x
Jefferson Gonçalves avatar Author: Jefferson Gonçalves

Package health

Automated checks of this plugin's Composer package

100 / 100
Security 100
Maintenance 100
Ecosystem 100
15 checks
  • Passed: GitHub Actions pinned to SHA
  • Skipped: GitLab CI includes pinned to SHA
  • Passed: Open security advisories
  • Passed: Dependabot PR responsiveness — No stale Dependabot PRs.
  • Skipped: Renovate MR responsiveness
  • Passed: Dependabot or Renovate configured
  • Passed: Dependency update cooldown configured
  • Passed: Provides a security policy
  • Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
  • Passed: Commit and release recency — Active: last commit 0 days ago; last release 10 days ago.
  • Passed: composer.lock not committed by library — composer.lock is absent from the released dist archive.
  • Passed: Dist archive is lean
  • Passed: Current Laravel version supported — Package dependencies resolve together with current Laravel 13.0.
  • Passed: Current PHP version supported — Constraint ^8.2 supports current PHP 8.5.
  • Skipped: Current Symfony version supported
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 1 month ago

Documentation

Version:

Filament Ban

Buy Me A Coffee

Latest Version on Packagist GitHub Code Style Action Status Total Downloads License

Ban and unban any Eloquent model directly from your Filament panel. This package wraps cybercog/laravel-ban and ships ready-to-use actions, bulk actions, an icon column and a status filter for your Filament resources and tables. Inspired by cybercog/laravel-nova-ban.

#Version Compatibility

Filament Laravel PHP Branch Version
v3 10 / 11 8.1+ 1.x ^1.0
v4 11 / 12 8.2+ 2.x ^2.0
v5 11.28 / 12 / 13 8.2+ 3.x ^3.0

All tags use plain SemVer without the v prefix (e.g. 3.0.0).

#Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-ban

Publish and run the cybercog/laravel-ban migration (creates the bans table):

php artisan vendor:publish --provider="Cog\Laravel\Ban\Providers\BanServiceProvider" --tag="migrations"
php artisan migrate

Then add a nullable banned_at timestamp column to each bannable model's table:

Schema::table('users', function (Blueprint $table) {
    $table->timestamp('banned_at')->nullable();
});

#Preparing your model

Make any Eloquent model bannable by implementing the contract and using the trait:

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;
}

#Usage

#Actions

Add ban / unban buttons to a resource table row. Each action shows only when relevant (Ban when the record is not banned, Unban when it is). BanAction opens a modal where you can set an optional comment and an optional expiration date.

use JeffersonGoncalves\Filament\Ban\Actions\BanAction;
use JeffersonGoncalves\Filament\Ban\Actions\UnbanAction;

public function table(Table $table): Table
{
    return $table
        ->recordActions([
            BanAction::make(),
            UnbanAction::make(),
        ]);
}

#Bulk actions

use JeffersonGoncalves\Filament\Ban\Actions\BanBulkAction;
use JeffersonGoncalves\Filament\Ban\Actions\UnbanBulkAction;

$table->toolbarActions([
    BanBulkAction::make(),
    UnbanBulkAction::make(),
]);

#Column

Display the current ban status as a boolean icon:

use JeffersonGoncalves\Filament\Ban\Tables\Columns\BanColumn;

$table->columns([
    BanColumn::make(),
]);

#Filter

Filter records by ban status (uses the onlyBanned / withoutBanned scopes):

use JeffersonGoncalves\Filament\Ban\Tables\Filters\BanFilter;

$table->filters([
    BanFilter::make(),
]);

#Development

# Run static analysis
composer analyse

# Run tests
composer test

# Format code
composer format

#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.

The author

Jefferson Gonçalves avatar Author: Jefferson Gonçalves

I'm a Full Stack PHP Developer from Assis, SP, Brazil with over 18 years of hands-on experience building robust platforms, managing server infrastructures, and crafting scalable solutions for businesses of all sizes.

My passion lives in the open source world — I actively maintain 20+ Filament plugins and a growing collection of Laravel packages used by thousands of developers worldwide. I believe great software should be accessible to everyone.

Plugins
43
Stars
208

From the same author

Scanner Guard plugin thumbnail

Scanner Guard

Filament UI for jeffersongoncalves/laravel-scanner-guard: list, filter and unban vulnerability-scanner IPs directly from your admin panel. This plugin ships a read-only Resource over the scanner_guard_bans table, an active/expired filter, and unban / bulk unban actions.

Jefferson Gonçalves avatar Author: Jefferson Gonçalves
100 / 100 package health score out of 100
0 stars
Tag: Widget Tag: Analytics
Dark mode ready Multilingual support
Free
Get it now
Short URL plugin thumbnail

Short URL

A complete Filament v5 admin layer for jeffersongoncalves/laravel-short-url — the headless core package that owns the models, migrations, redirect pipeline, tracking and every business rule. This package duplicates none of that: it's the presentation layer (Resources, Pages and Filament components) built on top of the core's Facade and contracts.

Jefferson Gonçalves avatar Author: Jefferson Gonçalves
100 / 100 package health score out of 100
3 stars
Tag: Analytics Tag: Widget
Dark mode ready Multilingual support
Free
Get it now
TeamKit v5 plugin thumbnail

TeamKit v5

Teamkit is a robust starter kit, designed to accelerate the development of modern web applications with a ready-to-use multi-panel structure.

Jefferson Gonçalves avatar Author: Jefferson Gonçalves
97 / 100 package health score out of 100
6 stars
Tag: Kit
Dark mode ready Multilingual support
Free
Get it now
Service Desk plugin thumbnail

Service Desk

Filament plugin for complete service desk management — Admin, Agent, and User panels for tickets, SLA, and customer support.

Jefferson Gonçalves avatar Author: Jefferson Gonçalves
97 / 100 package health score out of 100
7 stars
Tag: Tables Tag: Panels More tags: +2
Dark mode ready Multilingual support
Free
Get it now