Skip to content

Commit

Permalink
Add filters from PrintQueue widget
Browse files Browse the repository at this point in the history
  • Loading branch information
techenby committed May 17, 2023
1 parent 8c857a5 commit 06b5ec3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Filament/Resources/JobResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Filament\Tables\Columns\ColorColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Filters\SelectFilter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;

Expand Down Expand Up @@ -197,6 +198,12 @@ public static function table(Table $table): Table
fn (Builder $query): Builder => $query->orWhere(fn ($query) => $query->whereNotNull('started_at')->whereNotNull('failed_at')->whereNull('completed_at')),
);
}),
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'),
])
->defaultSort('created_at', 'desc')
->actions([
Expand Down

0 comments on commit 06b5ec3

Please sign in to comment.