apimediaru / nova-tinymce
A Laravel Nova field that provides integration of TinyMCE.
Installs: 196
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: >=8.0
- laravel/nova: ^4.0
README
Installation
- Install the package
composer require apimediaru/nova-tinymce
- Publish assets
php artisan nova-tinymce:publish
Publishing assets
Config
php artisan vendor:publish --tag=nova-tinymce-config
Localizations
php artisan vendor:publish --tag=nova-tinymce-lang
Assets
(enables skins, languages and plugins)
php artisan vendor:publish --tag=nova-tinymce-assets
Usage
Example of usage in Nova:
use APIMedia\TinyMCE\TinyMCE;
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
// ...
TinyMCE::make('Content'), 'content'),
];
}
Configurable parameters
TinyMCE frontend display height. Passing int
means height in pixels, but also you can pass string
with a css value, for example, 20rem
.
TinyMCE::make('Content'), 'content')
->height(150),
Override default editor settings for a certain field: editorConfig(array $config): array
.
Docs for TinyMCE can be found here.
TinyMCE::make('Content'), 'content')
->editorConfig([
'menubar' => false,
'plugins' => [
// Some plugins
],
'toolbar' => 'any custom toolbar items',
// ...
]),