Skip to content

Commit

Permalink
Add queries
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvg93 committed Dec 17, 2024
1 parent 165e132 commit e1ca289
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/Filament/Resources/ResultResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public static function form(Form $form): Form
->content(fn (Result $result): ?string => $result->comments),
Forms\Components\Checkbox::make('scheduled'),
Forms\Components\Checkbox::make('healthy'),

])
->columns(1)
->columnSpan([
Expand Down Expand Up @@ -318,6 +317,7 @@ public static function table(Table $table): Table
->boolean()
->toggleable()
->toggledHiddenByDefault()
->sortable()
->alignment(Alignment::Center),
Tables\Columns\TextColumn::make('created_at')
->dateTime(config('app.datetime_format'))
Expand Down Expand Up @@ -365,7 +365,12 @@ public static function table(Table $table): Table
Tables\Filters\TernaryFilter::make('healthy')
->nullable()
->trueLabel('Only healthy speedtests')
->falseLabel('Only unhealthy speedtests'),
->falseLabel('Only unhealthy speedtests')
->queries(
true: fn (Builder $query) => $query->where('healthy', true),
false: fn (Builder $query) => $query->where('healthy', false),
blank: fn (Builder $query) => $query,
),
])
->actions([
Tables\Actions\ActionGroup::make([
Expand Down

0 comments on commit e1ca289

Please sign in to comment.