PHP code example of vibefilter / filament

1. Go to this page and download the library: Download vibefilter/filament 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/ */

    

vibefilter / filament example snippets


use Vibefilter\Filament\Tables\Filters\VibeFilter;

public static function configure(Table $table): Table
{
    return $table
        ->columns([
            // ...
        ])
        ->filters([
            VibeFilter::make()
                ->textColumns(['body']),
        ]);
}

VibeFilter::make()
    ->textColumns(['subject', 'body'])
    ->threshold(0.7)            // default: 0.8
    ->maxUnscoredRows(5000),    // default: 1000

use Vibefilter\Filament\Tables\Columns\VibeScoreColumn;

->columns([
    // ...
    VibeScoreColumn::make(),
])

use Filament\Actions\Action;

$table->filtersApplyAction(
    fn (Action $action) => $action->alpineClickHandler('close(); $wire.applyTableFilters()'),
);

VibeFilter::make()
    ->textColumns(['body'])
    ->thresholdTuner(),                 // or ->thresholdTuner([0.5, 0.7, 0.9])

// routes/console.php
use Illuminate\Support\Facades\Schedule;

Schedule::command('vibefilter:prune --days=90')->daily();

use Vibefilter\Filament\Contracts\DecisionDriver;
use Vibefilter\Filament\Drivers\FakeDriver;

$this->app->instance(DecisionDriver::class, new FakeDriver(
    fn (string $statement, string $text): float => str_contains($text, 'furious') ? 0.95 : 0.05,
));
bash
php artisan vendor:publish --tag="vibefilter-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="vibefilter-config"
bash
php artisan vendor:publish --tag="vibefilter-translations"