vasar/simplemde-support-uploadimage

simplemde 的 laravel-admin 扩展,支持粘贴、拖拽上传图片

0.0.2 2019-02-18 11:47 UTC

This package is auto-updated.

Last update: 2024-09-06 10:35:26 UTC


README

支持粘贴,拖拽图片上传

安装

$ composer require vasar/simplemde-support-uploadimage

$ php artisan vendor:publish
> select [Vasar\Simplemde\SimplemdeServiceProvider]

用法

在 config/admin.php 文件的扩展部分

'extensions' => [

    'simplemde' => [

        // Set to false if you want to disable this extension
        'enable' => true,

        // If you want to set an alias for the calling method
        //'alias' => 'markdown',

        // Editor configuration
        'config' => [

        ]
    ]
]

编辑器的配置可以在 Simplemde 文档 和上传图片配置中找到。

'config' => [
    'autofocus'   => true,
    'spellChecker' => false,
    'upload' => 'upload url',
    'uploadFieldName' => 'xxx_filedName', // 上传字段 默认:image
    'jsonFieldName' => 'xxx_jsonFieldName', // json 返回字段 默认:image
    
    ....
]

用于表单中

$form->simplemde('content');

许可证

MIT