PHP code example of marshmallow / nova-tinymce

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

    

marshmallow / nova-tinymce example snippets


use Marshmallow\Nova\Tinymce\TinyMCE;

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        TinyMCE::make(__('Content'), 'content'),
    ];
}

TinyMCE::make('body')->buttons([
    'Name button' =>  'value of HTML',
    'Name button2' =>  '<p>More HTML</p>'
]),

TinyMCE::make('body')->variables([
    'name_var' =>  'value_var',
]),

TinyMCE::make('body')->height(300),

'custom_items' => [
    // This will add a .lead class on the paragraph tag.
    [
        'title' => 'Lead Paragraph',
        'block' => 'p',
        'classes' => 'lead',
    ],
],

TinyMCE::make('body')->options([
    'height' => '980'
]),
bash
php artisan vendor:publish --provider="Marshmallow\Nova\TinyMCE\FieldServiceProvider" --tag="resources"
bash
php artisan vendor:publish --provider="Marshmallow\Nova\TinyMCE\FieldServiceProvider" --tag="config"