From 97f77c6f70f6d25c158bafa9bd00c8aab669ed85 Mon Sep 17 00:00:00 2001 From: Matthew Myers Date: Fri, 15 Sep 2023 15:20:03 -0400 Subject: [PATCH] filters --- .../Pages/ListKnowledgeBaseItems.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/ListKnowledgeBaseItems.php b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/ListKnowledgeBaseItems.php index b88864b745..bf5689fc35 100644 --- a/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/ListKnowledgeBaseItems.php +++ b/app-modules/knowledge-base/src/Filament/Resources/KnowledgeBaseItemResource/Pages/ListKnowledgeBaseItems.php @@ -2,12 +2,14 @@ namespace Assist\KnowledgeBase\Filament\Resources\KnowledgeBaseItemResource\Pages; -use Filament\Actions; use Filament\Tables\Table; +use Filament\Actions\CreateAction; use Filament\Tables\Actions\EditAction; use Filament\Tables\Actions\ViewAction; use Filament\Tables\Columns\TextColumn; use Filament\Resources\Pages\ListRecords; +use Filament\Tables\Filters\SelectFilter; +use Filament\Tables\Filters\TernaryFilter; use Filament\Tables\Actions\BulkActionGroup; use Filament\Tables\Actions\DeleteBulkAction; use Assist\KnowledgeBase\Filament\Resources\KnowledgeBaseItemResource; @@ -44,6 +46,19 @@ public function table(Table $table): Table ->sortable(), ]) ->filters([ + SelectFilter::make('quality') + ->relationship('quality', 'name') + ->multiple() + ->preload(), + SelectFilter::make('status') + ->relationship('status', 'name') + ->multiple() + ->preload(), + SelectFilter::make('category') + ->relationship('category', 'name') + ->multiple() + ->preload(), + TernaryFilter::make('public'), ]) ->actions([ ViewAction::make(), @@ -59,7 +74,7 @@ public function table(Table $table): Table protected function getHeaderActions(): array { return [ - Actions\CreateAction::make(), + CreateAction::make(), ]; } }