PHP code example of filamentboot / filamentboot-markdown-editor

1. Go to this page and download the library: Download filamentboot/filamentboot-markdown-editor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

filamentboot / filamentboot-markdown-editor example snippets


use Filamentboot\FilamentbootMarkdownEditor\MarkdownEditorPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            MarkdownEditorPlugin::make(),
        ]);
}

use Filamentboot\FilamentbootMarkdownEditor\Forms\MarkdownEditorField;

MarkdownEditorField::make('content')
    ->label('内容')
    ->columnSpanFull(),

MarkdownEditorField::make('content')
    ->withSideBySide(false),

use Filamentboot\FilamentbootMarkdownEditor\Support\MarkdownRenderer;

$html = app(MarkdownRenderer::class)->render($markdownContent);
// 输出: {!! $html !!}(已经过 XSS 过滤,安全)
bash
php artisan vendor:publish --tag=filamentboot-markdown-editor-config