energon7/nova-tinymce
Composer 安装命令:
composer require energon7/nova-tinymce
包简介
This Nova package allow you to use TinyMCE editor for text areas.You can customize the editor options and... you can upload images to your server and put them rigth there on the text without leaving the text editor!
README 文档
README
This Nova package allow you to use TinyMCE editor for text areas. You can customize the editor options and... you can upload images to your server and put them right there on the text without leaving the text editor!!
Installation
composer require emilianotisato/nova-tinymce
In order to work with this editor you need to create a free account to get the editor API_KEY. Once you have don this, create this key inside your config/nova.php file
'tinymce_api_key' => env('TINYMCE_API_KEY'),
and add the TINYMCE_API_KEY to your .env file with the key from tiny.cloud website.
Usage
In your Nova resource add the use declaration and use the NovaTinyMCE field:
use Emilianotisato\NovaTinyMCE\NovaTinyMCE; // ... /** * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function fields(Request $request) { return [ ID::make()->sortable(), NovaTinyMCE::make('body'), ]; }
By default, the editor comes with default options and the image without the filemanager. You can use custome options like this:
NovaTinyMCE::make('body')->options([ 'plugins' => [ 'advlist autolink lists link image charmap print preview hr anchor pagebreak' ], 'toolbar' => 'insertfile undo redo | styleselect | bold italic' ]),
Using the upload images feature
Now if you need to upload images from the text editor, we need to install UniSharp Laravel Filemanager, and pass the use_lfm key to your options array:
NovaTinyMCE::make('body')->options([ 'plugins' => [ 'advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons template paste textcolor colorpicker textpattern' ], 'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media', 'use_lfm' => true ]),
In case you change the laravel-filemanager URL in the package config file, you need to pass that info to this nova field with the lfm_url key in the options array.
// ... 'use_lfm' => true, 'lfm_url' => 'laravel-filemanager' // ...
Extra configuration and plugin customization
You can virtually pass any configuration option for the javascript SDK to the array in the options() method.
For example, you like to have increased the height of the text area:
NovaTinyMCE::make('body')->options([ 'height' => '980' ]),
You can see the full list of parameters in the docs: https://www.tiny.cloud/docs-3x/reference/Configuration3x/
energon7/nova-tinymce 适用场景与选型建议
energon7/nova-tinymce 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「editor」 「nova」 「laravel」 「tiny」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 energon7/nova-tinymce 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 energon7/nova-tinymce 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 energon7/nova-tinymce 相关的其它包
同方向 / 同关键字的高下载量 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
Adds more BBCode
A Laravel Nova Image field. you can paste or drag or chose an image
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-08