08-05 17:11 dcat-admin php laravel 技巧 dcat-admin 处理自带tinymce富文本多图上传 ##### 1. 下载[附件](https://varwill-blog.oss-cn-beijing.aliyuncs.com/files/batchUploadImage.rar "附件")解压到项目 public\vendors\dcat-admin\dcat\plugins\tinymce\plugins 文件夹下。(上传地址为插件默认上传地址,如需自定义修改文件index.html 下JavaScript代码即可) ##### 2. 项目 找到\app\Admin\bootstrap.php为编辑器添加多图上传插件即可,代码如下。 ``` use Dcat\Admin\Form\Field\Editor; Editor::resolving(function (Editor $editor) { $editor->options([ 'plugins' => [ 'advlist', 'autolink', 'link', 'image', 'media', 'lists', 'preview', 'code', 'help', 'fullscreen', 'table', 'autoresize', 'codesample', 'batchUploadImage', ], 'toolbar' => [ 'undo redo | preview fullscreen | styleselect | fontsizeselect bold italic underline strikethrough forecolor backcolor | link image batchUploadImage media blockquote removeformat codesample', 'alignleft aligncenter alignright alignjustify| indent outdent bullist numlist table subscript superscript | code', ], 'min_height' => 400, 'save_enablewhendirty' => true, 'convert_urls' => false, ]); }); ``` ##### 添加完成后效果如下图 ![](http://varwill-blog.oss-cn-beijing.aliyuncs.com/markdown/images/4a47a0db6e60853dedfcfdf08a5ca249610bb5cd5a02d.png) ![](http://varwill-blog.oss-cn-beijing.aliyuncs.com/markdown/images/59e6c3e012e5fb495344113c84c80ffa610bb5db4ba5b.png)