miles/nova-trumbowyg

A Laravel Nova WYSIWYG Editor With Upload Image MediaLibrary.

0.0.7 2019-05-22 06:20 UTC

README

Installation

composer require miles/nova-trumbowyg

Usage

NovaTrumbowyg::make('story')
    ->config([
        'btns' => [
            ['viewHTML'],
            ['undo', 'redo'],
            ['formatting'],
            ['strong', 'em', 'del'],
            ['superscript', 'subscript'],
            ['link'],
            ['image'],
            ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
            ['unorderedList', 'orderedList'],
            ['horizontalRule'],
            ['removeformat'],
            ['fullscreen'],
        ],
        'minimalLinks' => true,
        'removeformatPasted' => true,
        'resetCss' => true,
        'semantic' => [
            'strike' => 's',
            'del' => 's',
        ],
        'tagsToRemove' => ['script', 'link'],
        'urlProtocol' => true,
    ])
    ->mediaLibrary('story', 'App\User', $user_id);
    ->hideFromIndex(),

Optional

  • config (custom | not required)
->config([...])
  • mediaLibrary ( For MediaLibrary | not required)
->mediaLibrary(
    string $mediaCollection,
    string $modelName,
    int $modelId,
    array $data = []
)
  • serverPath (path = api route | not required)
->serverPath($path = null, $data = [])