File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 3333 */
3434 'prune_after_days ' => 30 ,
3535
36+
37+ /*
38+ * Options: 'rich', 'markdown'
39+ */
40+ 'editor ' => 'rich ' ,
41+
3642 /*
3743 * The rich editor toolbar buttons that are available to users.
3844 */
Original file line number Diff line number Diff line change 4646 </div >
4747
4848 <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
5054 </div >
5155 </div >
5256 </div >
Original file line number Diff line number Diff line change @@ -31,14 +31,24 @@ public function form(Form $form): Form
3131 return $ form ;
3232 }
3333
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+
3449 return $ form
3550 ->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 ,
4252 ])
4353 ->statePath ('data ' );
4454 }
You can’t perform that action at this time.
0 commit comments