File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/Fields/Configs/Concerns Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 33namespace SolutionForest \InspireCms \Fields \Configs \Concerns ;
44
55use Filament \Forms \Components \CheckboxList ;
6+ use Filament \Forms \Components \Select ;
67use Filament \Forms \Components \TextInput ;
78
89trait EditorBasicTrait
@@ -18,16 +19,24 @@ trait EditorBasicTrait
1819 protected static function getEditorBasicTraitComponent ($ name )
1920 {
2021 $ defaultDisk = config ('filesystems.default ' , 'public ' );
22+ $ disks = config ('filesystems.disks ' , []);
2123
2224 return match ($ name ) {
2325 'toolbarButtons ' => CheckboxList::make ('toolbarButtons ' )
2426 ->options (static ::getAllAvailableToolbarButtons ())
2527 ->bulkToggleable ()
2628 ->columns (3 ),
2729
28- 'fileAttachmentsDisk ' => TextInput::make ('fileAttachmentsDisk ' )->label ('Disk ' )->default ($ defaultDisk ),
30+ 'fileAttachmentsDisk ' => Select::make ('fileAttachmentsDisk ' )->label ('Disk ' )
31+ ->default ($ defaultDisk )
32+ ->options (collect ($ disks )->keys ()->mapWithKeys (fn ($ disk ) => [$ disk => $ disk ])->all ()),
2933 'fileAttachmentsDirectory ' => TextInput::make ('fileAttachmentsDirectory ' )->label ('Directory ' ),
30- 'fileAttachmentsVisibility ' => TextInput::make ('fileAttachmentsVisibility ' )->label ('Visibility ' )->default (config ("filesystems.disks. {$ defaultDisk }.visibility " )),
34+ 'fileAttachmentsVisibility ' => Select::make ('fileAttachmentsVisibility ' )->label ('Visibility ' )
35+ ->default ($ disks [$ defaultDisk ]['visibility ' ] ?? 'public ' )
36+ ->options ([
37+ 'public ' => 'Public ' ,
38+ 'private ' => 'Private ' ,
39+ ]),
3140 default => null ,
3241 };
3342 }
You can’t perform that action at this time.
0 commit comments