File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ return [
5050 'model' => RectitudeOpen\FilamentSiteSnippets\Models\SiteSnippet::class,
5151 'navigation_sort' => 0,
5252 'navigation_icon' => 'heroicon-o-puzzle-piece',
53+ 'editor_component_class' => \Filament\Forms\Components\RichEditor::class,
5354];
5455```
5556
Original file line number Diff line number Diff line change 77 'model ' => RectitudeOpen \FilamentSiteSnippets \Models \SiteSnippet::class,
88 'navigation_sort ' => 0 ,
99 'navigation_icon ' => 'heroicon-o-puzzle-piece ' ,
10+ 'editor_component_class ' => \Filament \Forms \Components \RichEditor::class,
1011];
Original file line number Diff line number Diff line change 55namespace RectitudeOpen \FilamentSiteSnippets \Resources ;
66
77use Filament \Forms ;
8+ use Filament \Forms \Components \RichEditor ;
89use Filament \Forms \Form ;
910use Filament \Resources \Resource ;
1011use Filament \Tables ;
@@ -47,6 +48,7 @@ public static function getNavigationGroup(): ?string
4748
4849 public static function form (Form $ form ): Form
4950 {
51+
5052 return $ form
5153 ->schema ([
5254 Forms \Components \Group::make ()
@@ -63,12 +65,17 @@ public static function form(Form $form): Form
6365 ->autosize (),
6466 ];
6567 case 'html ' :
66- return [
67- Forms \Components \RichEditor::make ($ contentFieldName )
68- ->label (__ ('filament-site-snippets::filament-site-snippets.field.html ' ))
69- ->maxLength (65535 )
70- ->required (),
71- ];
68+ $ editorClass = config ('filament-site-snippets.editor_component_class ' , RichEditor::class);
69+ $ editorComponent = $ editorClass ::make ($ contentFieldName )
70+ ->label (__ ('filament-site-snippets::filament-site-snippets.field.html ' ))
71+ ->fileAttachmentsDisk ('public ' )
72+ ->fileAttachmentsDirectory ('uploads ' )
73+ ->fileAttachmentsVisibility ('public ' )
74+ ->columnSpan ('full ' )
75+ ->maxLength (65535 )
76+ ->required ();
77+
78+ return [$ editorComponent ];
7279 case 'image ' :
7380 return [
7481 Forms \Components \FileUpload::make ($ contentFieldName )
You can’t perform that action at this time.
0 commit comments