PHP code example of moonshine / easymde

1. Go to this page and download the library: Download moonshine/easymde 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/ */

    

moonshine / easymde example snippets


use MoonShine\EasyMde\Fields\Markdown;

// ...

Markdown::make('Description')

php artisan vendor:publish --tag="moonshine-easymde-config"

'previewClass' => ['prose', 'dark:prose-invert'],
'forceSync' => true,
'spellChecker' => false,
'status' => false,
'toolbar' => [
    'bold', 'italic', 'strikethrough', 'code', 'quote', 'horizontal-rule', '|', 'heading-1',
    'heading-2', 'heading-3', '|', 'table', 'unordered-list', 'ordered-list', '|', 'link', 'image', '|',
    'preview', 'side-by-side', 'fullscreen', '|', 'guide',
],

toolbar(string|bool|array $toolbar)

Markdown::make('Description')
    ->toolbar(['bold', 'italic', 'strikethrough', 'code', 'quote', 'horizontal-rule'])

addOption(string $name, string|int|float|bool|array $value)

Markdown::make('Description')
    ->addOption('toolbar', ['bold', 'italic', 'strikethrough', 'code', 'quote', 'horizontal-rule'])