Skip to content

Commit

Permalink
Add filters
Browse files Browse the repository at this point in the history
  • Loading branch information
techenby committed May 14, 2023
1 parent ce6daee commit ba96d1a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Filament/Widgets/PrintQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Columns\ColorColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Filters\SelectFilter;
use Filament\Widgets\TableWidget as BaseWidget;
use Illuminate\Database\Eloquent\Builder;

Expand Down Expand Up @@ -72,6 +73,18 @@ protected function getTableActions(): array
];
}

protected function getTableFilters(): array
{
return [
SelectFilter::make('color_hex')
->label('Color')
->multiple()
->options(auth()->user()->currentTeam->materials->pluck('name', 'color_hex')),
SelectFilter::make('printType')->relationship('printType', 'name'),
SelectFilter::make('user')->relationship('user', 'name'),
];
}

protected function getTableHeaderActions(): array
{
return [
Expand Down

0 comments on commit ba96d1a

Please sign in to comment.