@@ -21,39 +21,35 @@ final class ThreadResource extends Resource
21
21
22
22
protected static ?string $ navigationIcon = 'heroicon-o-chat-bubble-left-right ' ;
23
23
24
- public static function getNavigationGroup (): ? string
24
+ public static function getNavigationGroup (): string
25
25
{
26
26
return __ ('Forum ' );
27
27
}
28
-
29
28
public static function table (Table $ table ): Table
30
29
{
31
30
return $ table
32
31
->columns ([
33
32
TextColumn::make ('title ' )
34
33
->label ('Titre ' )
35
34
->sortable (),
35
+ TextColumn::make ('user.name ' )
36
+ ->label ('Auteur ' ),
36
37
IconColumn::make ('locked ' )
37
38
->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 ' ),
46
44
IconColumn::make ('resolved_by ' )
47
- ->label ('Résolut ' )
45
+ ->label ('Résolu ' )
48
46
->getStateUsing (fn ($ record ) => $ record ->resolved_by == null ? 'heroicon-s-x-mark ' : 'heroicon-s-check ' )
49
47
->icon (fn ($ state ) => $ state )
50
48
->color (fn ($ state ) => $ state === 'heroicon-s-x-mark ' ? 'warning ' : 'success ' )
51
49
->sortable (),
52
50
TextColumn::make ('created_at ' )
53
51
->label ('Date de publication ' )
54
52
->dateTime (),
55
- TextColumn::make ('user.name ' )
56
- ->label ('Auteur ' ),
57
53
])
58
54
->filters ([
59
55
SelectFilter::make ('Channels ' )->relationship ('channels ' , 'name ' )->searchable ()->preload (),
0 commit comments