statview / filament-record-finder
Record finder form component for Filament
1.0.1
2024-12-19 15:39 UTC
Requires
- filament/filament: ^v3.0.0
- illuminate/support: ^v10.0.0
- spatie/php-structure-discoverer: ^2.0
README
Installation
composer require statview/filament-record-finder
Create record finder classes
use App\Models\User; use Filament\Tables\Columns; use Filament\Tables\Table; use Statview\FilamentRecordFinder\RecordFinder; class RecordFinderDemo extends RecordFinder { public function table(Table $table) { return $table ->query( fn () => User::query() ->whereNotIn('id', $this->existingRecord) ) ->columns([ Columns\TextColumn::make('name') ->searchable() ->sortable(), ]); } }
Usage
use Filament\Tables\Columns\TextColumn; use Statview\FilamentRecordFinder\Forms\RecordFinder; RecordFinder::make('pages') ->label('Subpages') ->relation('pages', 'title') ->grid() ->recordFinder(RecordFinderDemo::class),