kraftbit/nova-tinymce5-editor
Composer 安装命令:
composer require kraftbit/nova-tinymce5-editor
包简介
A Laravel Nova field.
README 文档
README
Nova TinyMCE 5 Editor is Laravel Nova field that integrates TinyMCE5 WYSIWYG editor.
Installation
Use the composer to install this package.
composer require kraftbit/nova-tinymce5-editor
Usage
Publish config with the following command:
php artisan vendor:publish --provider="Kraftbit\NovaTinymce5Editor\FieldServiceProvider"
Now you have nova-tinymce5-editor.php file in your config folder. Edit TinyMCE options and toolbar here.
Add your TinyMCE cloud API key here or to your .env file like this:
TINYMCE_API_KEY=your-key-here
After that you are good to go! Add NovaTinymce5Editor class and field to your Nova Resource.
use Kraftbit\NovaTinymce5Editor\NovaTinymce5Editor; ... NovaTinymce5Editor::make('Body', 'body'),
Available options
You can pass arguments and TinyMCE options directly from a field to customize your toolbar and plugins, like this:
NovaTinymce5Editor::make('Body')->placeholder('Enter content here') ->options(['toolbar' => ['undo redo | align | link | code'], 'plugins' => ['link code']]),
For available options/plugins visit official TinyMCE 5 documentation.
Integration with Media Library
Nova TinyMCE 5 Editor field works well with Nova Media Library. If you would like to insert images from Media Library directly to editor content, you need to install Nova Media Library field first and add a Media Library JS callback field. To make it work, you need to add custom *id for TinyMCE field ->id('body'), and meta argument ->withMeta(['mediaLibrary' => true]) and then pass the same editor *id to your Media Library callback field. In the example below we use 'body' for *id because that is the column name in our database:
NovaTinymce5Editor::make('Body')->id('body')->withMeta(['mediaLibrary' => true]), MediaLibrary::make('Insert image', 'js_callback_media_library') ->jsCallback('mediaLibrarySelectFiles', ['editor' => 'body'])->types(['Image']),
Screenshots
TinyMCE editor without inserted image
TinyMCE editor with inserted image
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
kraftbit/nova-tinymce5-editor 适用场景与选型建议
kraftbit/nova-tinymce5-editor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 60.67k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2020 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nova」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kraftbit/nova-tinymce5-editor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kraftbit/nova-tinymce5-editor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kraftbit/nova-tinymce5-editor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
A Laravel Nova Mail testing tool.
统计信息
- 总下载量: 60.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-21