PHP code example of jeffersongoncalves / filament-ban

1. Go to this page and download the library: Download jeffersongoncalves/filament-ban library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffersongoncalves / filament-ban example snippets


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

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

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(),
        ]);
}

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

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

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

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

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

$table->filters([
    BanFilter::make(),
]);
bash
php artisan vendor:publish --provider="Cog\Laravel\Ban\Providers\BanServiceProvider" --tag="migrations"
php artisan migrate