File tree 3 files changed +27
-7
lines changed
3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 33
33
*/
34
34
'prune_after_days ' => 30 ,
35
35
36
+
37
+ /*
38
+ * Options: 'rich', 'markdown'
39
+ */
40
+ 'editor ' => 'rich ' ,
41
+
36
42
/*
37
43
* The rich editor toolbar buttons that are available to users.
38
44
*/
Original file line number Diff line number Diff line change 46
46
</div >
47
47
48
48
<div class =" prose dark:prose-invert [& >*]:mb-2 [& >*]:mt-0 [& >*:last-child]:mb-0 prose-sm text-sm leading-6 text-gray-950 dark:text-white" >
49
- {{ Str:: of ($comment -> comment )-> toHtmlString () } }
49
+ @if (config (' filament-comments.editor' ) === ' markdown' )
50
+ {{ Str:: of ($comment -> comment )-> markdown ()-> toHtmlString () } }
51
+ @else
52
+ {{ Str:: of ($comment -> comment )-> toHtmlString () } }
53
+ @endif
50
54
</div >
51
55
</div >
52
56
</div >
Original file line number Diff line number Diff line change @@ -31,14 +31,24 @@ public function form(Form $form): Form
31
31
return $ form ;
32
32
}
33
33
34
+ if (config ('filament-comments.editor ' ) === 'markdown ' ) {
35
+ $ editor = Forms \Components \MarkdownEditor::make ('comment ' )
36
+ ->hiddenLabel ()
37
+ ->required ()
38
+ ->placeholder (__ ('filament-comments::filament-comments.comments.placeholder ' ))
39
+ ->toolbarButtons (config ('filament-comments.toolbar_buttons ' ));
40
+ } else {
41
+ $ editor = Forms \Components \RichEditor::make ('comment ' )
42
+ ->hiddenLabel ()
43
+ ->required ()
44
+ ->placeholder (__ ('filament-comments::filament-comments.comments.placeholder ' ))
45
+ ->extraInputAttributes (['style ' => 'min-height: 6rem ' ])
46
+ ->toolbarButtons (config ('filament-comments.toolbar_buttons ' ));
47
+ }
48
+
34
49
return $ form
35
50
->schema ([
36
- Forms \Components \RichEditor::make ('comment ' )
37
- ->hiddenLabel ()
38
- ->required ()
39
- ->placeholder (__ ('filament-comments::filament-comments.comments.placeholder ' ))
40
- ->extraInputAttributes (['style ' => 'min-height: 6rem ' ])
41
- ->toolbarButtons (config ('filament-comments.toolbar_buttons ' ))
51
+ $ editor ,
42
52
])
43
53
->statePath ('data ' );
44
54
}
You can’t perform that action at this time.
0 commit comments