Skip to content

Commit 2288336

Browse files
authored
toggle some results columns and put actions under group (alexjustesen#224)
1 parent 4c7c64b commit 2288336

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

app/Filament/Resources/ResultResource.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ public static function table(Table $table): Table
3030
TextColumn::make('id')
3131
->label('ID'),
3232
IconColumn::make('scheduled')
33-
->boolean(),
33+
->boolean()
34+
->toggleable()
35+
->toggledHiddenByDefault(),
3436
ViewColumn::make('download')
3537
->view('tables.columns.bits-column'),
3638
ViewColumn::make('upload')
3739
->view('tables.columns.bits-column'),
38-
TextColumn::make('ping'),
40+
TextColumn::make('ping')
41+
->toggleable(),
3942
ViewColumn::make('server_id')
4043
->label('Server ID')
41-
->view('tables.columns.server-column'),
44+
->view('tables.columns.server-column')
45+
->toggleable(),
4246
TextColumn::make('created_at')
4347
->dateTime($settings->time_format ?? 'M j, Y G:i:s')
4448
->timezone($settings->timezone ?? 'UTC'),
@@ -47,12 +51,15 @@ public static function table(Table $table): Table
4751
//
4852
])
4953
->actions([
50-
// Tables\Actions\ViewAction::make(),
51-
Action::make('view result')
52-
->label('View on Speedtest.net')
53-
->url(fn (Result $record): string => $record->url)
54-
->openUrlInNewTab(),
55-
Tables\Actions\DeleteAction::make(),
54+
Tables\Actions\ActionGroup::make([
55+
Action::make('view result')
56+
->label('View on Speedtest.net')
57+
->icon('heroicon-o-link')
58+
->url(fn (Result $record): string => $record->url)
59+
->openUrlInNewTab(),
60+
// Tables\Actions\ViewAction::make(),
61+
Tables\Actions\DeleteAction::make(),
62+
]),
5663
])
5764
->bulkActions([
5865
Tables\Actions\DeleteBulkAction::make(),

0 commit comments

Comments
 (0)