mr4-lax/tiny-mce

Laravel admin form TinyMCE

0.0.1 2023-07-21 03:13 UTC

This package is auto-updated.

Last update: 2024-04-12 06:44:47 UTC


README

This is a laravel-admin extension that integrates TinyMCE 6 into the laravel-admin form.

Screenshot

Screenshot 2023-07-21 at 10 52 44

Installation

composer require mr4-lax/tiny-mce
php artisan vendor:publish --tag=mr4-lax-tinymce --force

Configuration

In the extensions section of the config/admin.php file, add some configuration that belongs to this extension.

'extensions' => [
    'mr4lax' => [
        // If the value is set to false, this extension will be disabled
        'enable' => true,
        'tinymce' => [
            'editor' => [
                'plugins' => 'table lists link image media wordcount',
                'toolbar' => 'undo redo | formatselect| bold italic underline strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | indent outdent | bullist numlist | code | table | image media link',
            ],
            'editor' => [
                'upload' => 'mr4.lax.tinymce.upload',
                'store' => 'public/mr4lax/tinymce',
            ],
        ],
    ],
],

The configuration of plugins and toolbar of the editor can be found in TinyMCE Document

Usage

Use it in the form:

$form->tinymce('content')
  ->rows(5)
  ->attribute([
      'menubar' => 'true',
      'statusbar' => 'true',
  ]);

License

Licensed under The MIT License (MIT).