44
55use App \Filament \Resources \SettingResource \Pages ;
66use App \Models \Setting ;
7- use Filament \Forms \Components ;
87use Filament \Resources \Resource ;
9- use Filament \Tables \Actions ;
108use Filament \Tables \Columns ;
119use Filament \Tables \Table ;
1210
@@ -19,44 +17,14 @@ public static function table(Table $table): Table
1917 {
2018 return $ table
2119 ->defaultSort ('weight ' , 'asc ' )
22- ->reorderable ('weight ' )
2320 ->columns ([
2421 Columns \TextColumn::make ('field ' )
2522 ->label (__ ('field ' ))
2623 ->state (fn (Setting $ record ): string => "{$ record ->label } (<code> {$ record ->field }</code>) " )
2724 ->html (),
28- Columns \TextColumn ::make ('value ' )
25+ Columns \TextInputColumn ::make ('value ' )
2926 ->label (__ ('value ' ))
30- ->limit (),
31- ])
32- ->filters ([
33- //
34- ])
35- ->actions ([
36- Actions \EditAction::make ()
37- ->label ('' )
38- ->form (fn (Setting $ record ) => match ($ record ->type ) {
39- 'text ' , 'email ' , 'tel ' , 'url ' , 'number ' => [
40- Components \TextInput::make ('value ' )
41- ->label ($ record ->label )
42- ->email ($ record ->type === 'email ' )
43- ->tel ($ record ->type === 'tel ' )
44- ->url ($ record ->type === 'url ' )
45- ->numeric ($ record ->type === 'number ' )
46- ->autofocus ()
47- ],
48- 'textarea ' => [
49- Components \Textarea::make ('value ' )
50- ->label ($ record ->label )
51- ->autosize ()
52- ->autofocus ()
53- ],
54- default => [
55- Components \TextInput::make ('value ' )
56- ->label ($ record ->label )
57- ->autofocus ()
58- ]
59- }),
27+ ->grow (),
6028 ])
6129 ->paginated (false );
6230 }
0 commit comments