Skip to content

Commit 75c5e8d

Browse files
feat:[lar-129] modify icon columns , move author columns...
1 parent d7baa48 commit 75c5e8d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

app/Filament/Resources/ThreadResource.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,35 @@ final class ThreadResource extends Resource
2121

2222
protected static ?string $navigationIcon = 'heroicon-o-chat-bubble-left-right';
2323

24-
public static function getNavigationGroup(): ?string
24+
public static function getNavigationGroup(): string
2525
{
2626
return __('Forum');
2727
}
28-
2928
public static function table(Table $table): Table
3029
{
3130
return $table
3231
->columns([
3332
TextColumn::make('title')
3433
->label('Titre')
3534
->sortable(),
35+
TextColumn::make('user.name')
36+
->label('Auteur'),
3637
IconColumn::make('locked')
3738
->label('Vérrouillé')
38-
->options([
39-
'heroicon-s-lock-closed' => fn ($record) => $record->locked === true,
40-
'heroicon-s-lock-open' => fn ($record) => $record->locked === false,
41-
])
42-
->colors([
43-
'warning' => fn ($record) => $record->locked === true,
44-
'success' => fn ($record) => $record->locked === false,
45-
]),
39+
->boolean()
40+
->trueIcon('heroicon-s-lock-closed')
41+
->trueColor('warning')
42+
->falseIcon('heroicon-s-lock-open')
43+
->falseColor('success'),
4644
IconColumn::make('resolved_by')
47-
->label('Résolut')
45+
->label('Résolu')
4846
->getStateUsing(fn ($record) => $record->resolved_by == null ? 'heroicon-s-x-mark' : 'heroicon-s-check')
4947
->icon(fn ($state) => $state)
5048
->color(fn ($state) => $state === 'heroicon-s-x-mark' ? 'warning' : 'success')
5149
->sortable(),
5250
TextColumn::make('created_at')
5351
->label('Date de publication')
5452
->dateTime(),
55-
TextColumn::make('user.name')
56-
->label('Auteur'),
5753
])
5854
->filters([
5955
SelectFilter::make('Channels')->relationship('channels', 'name')->searchable()->preload(),

0 commit comments

Comments
 (0)