集成富文本编辑器 laravel-ueditor
打赏作者

mostwin

这个https://github.com/andersao/l5-repository可以讲一下,个人觉得不错!

JellyBool 回复 mostwin

啊哈,我周末先更知乎系列的先

pluxwill 回复 mostwin

啊!我也期待这个的!

Frank0Hao 回复 mostwin

同样期待!!~

vinshaw

已看,这个好好用,感谢超哥和教主,以后做编辑器简直不要太爽!
ps:教主真人首秀啊!

JellyBool 回复 vinshaw

哈哈哈,超哥的代码很厉害的

JeffZhang 回复 JellyBool

超哥是谁?。。。。

hybridword

我发表一下看法哈
百度编辑器编辑的时候会自带标签,例如换行会多加

如此之类的,如果用户希望自定义样式,这会是一个很大的问题。

JellyBool 回复 hybridword

这个应该是可以配置的,是否去除空白行。

hybridword 回复 JellyBool

这个是配置不了的(因为我们正在修改这个编辑器)

JellyBool 回复 hybridword

纳尼,文档这里 http://fex.baidu.com/ueditor/#start-config

autoClearEmptyNode 不是你的需求么

John Howard

皮肤怎么设置呢?

JellyBool 回复 John Howard

你可以自定义 theme 的吧…就像知乎那个系列一样

LuoDestiny

Jelly 后期会弄 alioss 吗? 嘿嘿

JellyBool 回复 LuoDestiny

没看过这个 alioss 的文档。

xhh1100 回复 JellyBool

希望加入阿里的oss配置。。。

JellyBool 回复 xhh1100

你去写一个扩展呗

xhh1100 回复 JellyBool

也可以哈。。

making

ueditor 有点重,且不支持自适应,,用了一段时间后果断换了其它的富文本编辑器。。统属交流,并无它意!!!

JellyBool 回复 making

嗯哼,但是目前最好的 富文本编辑器还是 ueditor ,知乎就是用的ueditor吧

making 回复 JellyBool

WangEditor 这个不错,量级经,支持H5和自适应。。。我从UEditor 转到WangEditor了。

天山网艾克

AccessDeniedException in MimeTypeGuesser.php line 127:
The file /Applications/MAMP/tmp/php/phpByl519 could not be accessed

权限不足,文件找不到说的

JellyBool 回复 天山网艾克

你给一下权限呗

天山网艾克 回复 JellyBool

找不到知道文件夹 权限给了,给了最大的权限 还是一样,我得试一下别的办法吧 可能这mamp 不好使

天山网艾克 回复 JellyBool

这个权限的事情已解决了, 本地上传正常,七牛云上传 出现错误;错误提示如下:

FatalThrowableError in Client.php line 77:
Call to undefined function Qiniu\Http\curl_init()
JellyBool 回复 天山网艾克

你有更新 package?到支持七牛的版本么?有没有更多的报错信息

天山网艾克 回复 JellyBool

我这边package 全部更新好了

FatalThrowableError in Client.php line 77:
Call to undefined function Qiniu\Http\curl_init()
in Client.php line 77
at Client::sendRequest(object(Request)) in Client.php line 13
at Client::get('http://uc.qbox.me/v1/query?ak=VpeOXJHlLLtzLoMzTssYAOHjIbZazc_bFZSk3SzS&bucket=test') in Zone.php line 178
at Zone->bucketHosts('VpeOXJHlLLtzLoMzTssYAOHjIbZazc_bFZSk3SzS', 'test') in Zone.php line 93
at Zone->getBucketHosts('VpeOXJHlLLtzLoMzTssYAOHjIbZazc_bFZSk3SzS', 'test') in Zone.php line 53
at Zone->getUpHosts('VpeOXJHlLLtzLoMzTssYAOHjIbZazc_bFZSk3SzS', 'test') in Auth.php line 97
at Auth->uploadToken('test') in QiNiuStorage.php line 38
at QiNiuStorage->store(object(UploadedFile), '/uploads/image/2017/03/16/980b65115abbea096cb18547ff7846b4.png') in Manager.php line 137
at Manager->__call('store', array(object(UploadedFile), '/uploads/image/2017/03/16/980b65115abbea096cb18547ff7846b4.png')) in StorageManager.php line 56
at StorageManager->upload(object(Request)) in UEditorController.php line 45
at UEditorController->serve(object(Request))
at call_user_func_array(array(object(UEditorController), 'serve'), array(object(Request))) in Controller.php line 55
at Controller->callAction('serve', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(UEditorController), 'serve') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
JellyBool 回复 天山网艾克

首先尝试重新 安装这个 package (感觉就是代码没有安装完毕)。话说你有没有使用 composer 中国镜像?

大概看了一下,貌似是你有可能是没有安装 curl 和 php-curl 的支持

http://php.net/manual/en/function.curl-init.php

gg444108853
        'qiniu' => [
            'driver' => 'qiniu',
            'domains' => [
                'default' => 'xxxxx.com1.z0.glb.clouddn.com', //你的七牛域名
                'https' => 'dn-yourdomain.qbox.me',         //你的HTTPS域名
                'custom' => 'static.abc.com',                //你的自定义域名
            ],
            'access_key' => '',  //AccessKey
            'secret_key' => '',  //SecretKey
            'bucket' => '',  //Bucket名字
            'notify_url' => '',  //持久化处理回调地址
        ],

这个配置会不会和你的配置冲突 这是laravel七牛插件

这两个七牛的话 要是用肯定要用超哥的了…

JellyBool 回复 gg444108853

恩,你直接用超哥的。我正在重新提 pr ,这样就不会冲突了

gg444108853 回复 JellyBool
  • 恩 好的
  • 另外问一下你这个怎么解决防盗链问题的 后面参数是怎么获取到的?
DanceSmile

七牛的上传图片 是不是只能从本地上传到服务器 在从服务器上传到七牛云空间

JellyBool 回复 DanceSmile

不是啊,直接传的啊…你看看 laravel package 推荐那个系列的 editor 那集

zhenzihui

图片和文本一起发布了,可是怎么读取啊:p

JellyBool 回复 zhenzihui

读取什么?图片还是》?

zhenzihui 回复 JellyBool

解决了,原来挺简单的

LeoYang

按照视频及文档设置,本地上传正常,七牛云上传一直报错:未知错误
经测试使用 php 代码上传文件到七牛云成功

local.ERROR: Overtrue\LaravelUEditor\StoreErrorException: ERROR_UNKNOWN

jackdu

老师,有没有ueditor集成oss的包

jackdu

BadMethodCallException in PluggableTrait.php line 90:
Call to undefined method League\Flysystem\Filesystem::putFileAs
这个怎么解决

JellyBool 回复 jackdu

具体的代码是怎么样的

jackdu 回复 JellyBool

ueditor上传图片报错500,请求是http://local.junzhinuo1314.com/ueditor/server?action=upload-image&_token=qhzoQxZ6jPlUt0cEy8cYqVk6ibyyBbkP8QM0G5my 就返回上面错误了
config/filesystem.php 配置是 ‘disk’ => ‘local’, filesystems.php

'disks' => [
        'local' => [
            'driver' => 'local',
            'root'   => storage_path('app'),
        ],

页面错误信息

BadMethodCallException in PluggableTrait.php line 90:
Call to undefined method League\Flysystem\Filesystem::putFileAs
in PluggableTrait.php line 90
at Filesystem->__call('putFileAs', array('', object(UploadedFile), '/uploads/image/2017/04/27/eddf3c0d693357b309cc05d52f2cefdd.jpeg'))
at call_user_func_array(array(object(Filesystem), 'putFileAs'), array('', object(UploadedFile), '/uploads/image/2017/04/27/eddf3c0d693357b309cc05d52f2cefdd.jpeg')) in FilesystemAdapter.php line 350
at FilesystemAdapter->__call('putFileAs', array('', object(UploadedFile), '/uploads/image/2017/04/27/eddf3c0d693357b309cc05d52f2cefdd.jpeg')) in StorageManager.php line 125
at StorageManager->store(object(UploadedFile), '/uploads/image/2017/04/27/eddf3c0d693357b309cc05d52f2cefdd.jpeg') in StorageManager.php line 60
at StorageManager->upload(object(Request)) in UEditorController.php line 43
at UEditorController->serve(object(Request))
at call_user_func_array(array(object(UEditorController), 'serve'), array(object(Request))) in Controller.php line 256
at Controller->callAction('serve', array(object(Request))) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(UEditorController), object(Route), 'serve') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(UEditorController), object(Route), object(Request), 'serve') in ControllerDispatcher.php line 67
at ControllerDispatcher->dispatch(object(Route), object(Request), 'Overtrue\LaravelUEditor\UEditorController', 'serve') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 708
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 710
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 673
at Router->dispatchToRoute(object(Request)) in Router.php line 635
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 53
JellyBool 回复 jackdu

有可能是你使用的 5.4 的 laravel 版本,试试 使用 public 这个 driver:

 'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

再有就是,你自己写的代码具体是什么?

jackdu 回复 JellyBool

我是laravel5.1版本的,filesystems.php 当中并没有public-disk 只有一个local-disk , 我加上你发给我的public-disk也是不行啊,还是报这个错误
视图

    @include('vendor.ueditor.assets')
    <body>
        <div class="container">
            <div class="content">
                <div class="title">Laravel 5</div>
            </div>
        </div>
        <div>
        <!-- 实例化编辑器 -->
        <script type="text/javascript">
            var ue = UE.getEditor('container');
            ue.ready(function() {
                ue.execCommand('serverparam', '_token', '{ csrf_token() }'); // 设置 CSRF token.
            });
        </script>
        <!-- 编辑器容器 -->
        <script id="container" name="content" type="text/plain"></script>
        </div>
    </body>
filesystems.php
    'default' => 'local',

    /*
    |--------------------------------------------------------------------------
    | Default Cloud Filesystem Disk
    |--------------------------------------------------------------------------
    |
    | Many applications store files both locally and in the cloud. For this
    | reason, you may specify a default "cloud" driver here. This driver
    | will be bound as the Cloud disk implementation in the container.
    |
    */

    'cloud' => 's3',

    /*
    |--------------------------------------------------------------------------
    | Filesystem Disks
    |--------------------------------------------------------------------------
    |
    | Here you may configure as many filesystem "disks" as you wish, and you
    | may even configure multiple disks of the same driver. Defaults have
    | been setup for each driver as an example of the required options.
    |
    */

    'disks' => [
        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

        'local' => [
            'driver' => 'local',
            'root'   => storage_path('app'),
        ],


ueditor.php
    'disk' => 'public',
    'route' => [
        'name' => '/ueditor/server',
        'options' => [
            // middleware => 'auth',
        ],
    ],
JellyBool 回复 jackdu

控制器的代码有么?

jackdu 回复 JellyBool

我只是测试下ueditor图片上传功能,没有写控制器,就是简单路由返回视图

JellyBool 回复 jackdu

看不出什么错误了。你是怎么安装的 laravel5.1版本的?有没有可能是文件没下载完整?PluggableTrai
这个文件有咩有?

jackdu 回复 JellyBool

我是通过composer安装的 composer create-project laravel/laravel=5.1.* demo --prefer-dist
PluggableTrait.php这个文件是有的

<?php

namespace League\Flysystem\Plugin;

use BadMethodCallException;
use League\Flysystem\FilesystemInterface;
use League\Flysystem\PluginInterface;
use LogicException;

trait PluggableTrait
{
    /**
     * @var array
     */
    protected $plugins = [];

    /**
     * Register a plugin.
     *
     * @param PluginInterface $plugin
     *
     * @throws LogicException
     *
     * @return $this
     */
    public function addPlugin(PluginInterface $plugin)
    {
        if ( ! method_exists($plugin, 'handle')) {
            throw new LogicException(get_class($plugin) . ' does not have a handle method.');
        }

        $this->plugins[$plugin->getMethod()] = $plugin;

        return $this;
    }

    /**
     * Find a specific plugin.
     *
     * @param string $method
     *
     * @throws PluginNotFoundException
     *
     * @return PluginInterface
     */
    protected function findPlugin($method)
    {
        if ( ! isset($this->plugins[$method])) {
            throw new PluginNotFoundException('Plugin not found for method: ' . $method);
        }

        return $this->plugins[$method];
    }

    /**
     * Invoke a plugin by method name.
     *
     * @param string              $method
     * @param array               $arguments
     * @param FilesystemInterface $filesystem
     *
     * @throws PluginNotFoundException
     *
     * @return mixed
     */
    protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem)
    {
        $plugin = $this->findPlugin($method);
        $plugin->setFilesystem($filesystem);
        $callback = [$plugin, 'handle'];

        return call_user_func_array($callback, $arguments);
    }

    /**
     * Plugins pass-through.
     *
     * @param string $method
     * @param array  $arguments
     *
     * @throws BadMethodCallException
     *
     * @return mixed
     */
    public function __call($method, array $arguments)
    {
        try {
            return $this->invokePlugin($method, $arguments, $this);
        } catch (PluginNotFoundException $e) {
            throw new BadMethodCallException(
                'Call to undefined method '
                . get_class($this)
                . '::' . $method
            );
        }
    }
}
zhouyequ

这个在5.4下可以上传,但是成功之后返回的路径不对

xfabs 回复 zhouyequ

我也是这个问题欸。

xhh1100 回复 xfabs

5.4有坑、、、不稳定

xfabs 回复 xhh1100

我自己直接定义文件上传到public目录就好了,可能这有些弊端吧。

xiamihow

博主,laravel5.4,上传图片无法上传是怎么回事呢?![](file:///C:\Users\liang\Desktop)

JellyBool 回复 xiamihow

你仔细看看评论,基本上就是php artisan storage:link 就好了

yaoye6262

上传七牛云储存 上传错误!
配置什么都填写正确了!
还是上传错误!

yaoye6262

上传图片失败 报错:
FatalErrorException in Uploading.php line 24:
Trait ‘Illuminate\Foundation\Events\Dispatchable’ not found

使用的是laravel 5.2版本

JellyBool 回复 yaoye6262

感觉是没对应版本吧

yaoye6262 回复 JellyBool

一定要用5.4版本吗? 5.2不可用??

JellyBool 回复 yaoye6262

不是,是说 你用的 package 的版本对应一下 laravel 的版本。

也有可能是你的 laravel 文件就没下载完全

liang569874 回复 JellyBool

之前的项目是好的。5.3的版本,5.4的也可以,但现在把之前的项目git下来后,composer update下,就上传不了了,也是报的这个错误。我试了下5.4的倒是正常,不知道具体的原因是什么

liang569874 回复 JellyBool

之前的项目也是用的5.3

liang569874 回复 JellyBool

use Illuminate\Foundation\Events\Dispatchable;这个红了,看来更新后没有\Events这个目录下的文件了

心飞翔轩

可以加入QQ群问问题吗?

JellyBool 回复 心飞翔轩

你在群里问呗,不过技术问题我还是推荐你在社区发帖问

心飞翔轩

我用composer 下载后发现public/vendor/下没有php这个文件夹的。。。

JellyBool 回复 心飞翔轩

没有执行 vendor:publish 吧

心飞翔轩

是应该要设置路由获取上传图片的吧?

JellyBool 回复 心飞翔轩

不用的,这个 package 自带了的

btlfe

https://github.com/stevenyangecho/laravel-u-editor
和这个看起来好像,是同一个东西么?

JellyBool 回复 btlfe

ueditor 是百度开源的一个编辑器,只是不同的人写了不同的 package 让它集成到 laravel 中。

我是推荐使用 overtrue 的

btlfe

这个富文本编辑似乎有问题,图片设置左悬浮或右悬浮不能保存下来的样子

lioonline

图片上传成功但是返回 URL 错误是怎么回事

{state: "SUCCESS",…}
original
:
"download.jpg"
size
:
23180
state
:
"SUCCESS"
title
:
"/uploads/image/2017/07/27/100d10612cc8779cf357f72ca9153855.jpg"
type
:
""
url
:
"http://localhost/storage/uploads/image/2017/07/27/100d10612cc8779cf357f72ca9153855.jpg"

错误信息


localhost/storage/uploads/image/2017/07/27/100d10612cc8779cf357f72ca9153855.jpg:1 GET http://localhost/storage/uploads/image/2017/07/27/100d10612cc8779cf357f72ca9153855.jpg net::ERR_CONNECTION_REFUSED
JellyBool 回复 lioonline

这个并没有错吧,你先看看评论,应该就可以解决

yezhmao

请问一下用Ueditor编辑文章时,比如从网上复制文字,包含图片和段落格式等,我要保持原样的格式展示是怎样实现的呢?现在我复制粘贴存进数据库后,保存的是包含html标签的,展示的时候也是变成包含html标签,且文字全部挤在一起。这个是要保存的时候后台进行处理,还是展示的时候后台用Html转义之类的,或者是用Ueditor直接可以解析?(uparse?) 这个不太懂,麻烦解答一下,谢谢!

yezhmao

看到https://www.codecasts.com/series/develop-a-forum-using-laravel-5/episodes/12
这里评论区说的{} 与{!!!}的区别,看到自己用的是前一个,改成后面一个,就可以正常显示了~

yezhmao

用了这里的Laravel-Ueditor编辑器,想加支持Markdown格式的,按网站上另个视频的教程加SegmentFault / HyperDown解析是有问题的,想加支撑Markdown格式的话正确的方式是怎样的?

newbee

我用ueditor,如果验证失败,返回前一页的时候,内容框里的内容会带上html标签,这怎么处理?

JellyBool 回复 newbee

你是使用 {!! !!} 这种形式的么?

newbee 回复 JellyBool

哈哈,我也发现这个问题,基础太差啦

dangran

首先国庆快乐哈。
想问个问题,就是在看的视频中的一些配置和github上超哥的说明文档里面有些不一样了,
按照超哥的配置,配置完之后,点击上传图片报错,
ueditor::upload.upload.ERROR_TYPE_NOT_ALLOWED
自己不小心发现的一个问题,看报错是说,文件类型不对,但是我明明上传的是.jpg格式的图片,
后面换了一张图片,也是jpg格式的,居然上传成功了,觉得很奇怪,后面发现,竟然是后缀大小写的问题,
后缀为小写的jpg可以上传成功,
后缀为大写的JPG上传就会报前面的错误。

RuanZzzz

你好,请问我用了ueditor往里面添加图片后,图片是成功存储到文件夹了,但是却无法显示在编辑器里,请问是什么原因呢

JellyBool 回复 RuanZzzz

如果是本地的 driver,执行 artisan storage:link

RuanZzzz 回复 JellyBool

我之前也是执行过这个命令了,难道是我哪里不够仔细出错了?谢谢你的回复,我再去仔细检查下

JellyBool 回复 RuanZzzz

嗯,你仔细排查一下图片的链接和地址

RuanZzzz 回复 JellyBool

噢噢,我已经解决了,谢谢你哈,原来是我自己太粗心了呀!.env里面忘记设置APP_URL了,哈哈哈

JellyBool 回复 RuanZzzz

嗯,这种一般是图片的链接地址没对

我要1桶浆糊

想问一下,怎么获取上传文件的路径呢?毕竟删除一篇文章,怎么也得连带图片文件等等都删了,请问这个怎么做?

JellyBool 回复 我要1桶浆糊

这样的话,我觉得比较好的方式就是正则匹配,获取文章内容的 img 地址,在删除完图片之后再删文章

我要1桶浆糊 回复 JellyBool

目前我也是找到了这个办法,谢谢你的回答。不过我发现有些配置项无法生效,前来询问解决方案,例如imageMaxSize: {–} ,图片的上传大小限制,
var ue = UE.getEditor(‘container’, {
maximumWords: 100000,
imageMaxSize: 1, // /////此次无法生效//////////
videoMaxSize: 200000000 //////此次无法生效///////////
…许多未发掘
});
ue.ready(function () {
ue.execCommand(‘serverparam’, ‘_token’, ‘{ csrf_token() }’);
});
不知道我的设置对不对,图片依然可以上传1b以上的,请问怎么解决呢?

xshaitt

你好,我想问一下就是现在所有文件都在一个文件夹下,想要加载assets文件怎么加载,这个文件不在public文件夹下了?都在vendor-》overtrue-》laravel-ueditor-》src-》view-》assets下

JellyBool 回复 xshaitt

想要加载assets文件怎么加载,这个文件不在public文件夹下了?

什么意思?

xshaitt 回复 JellyBool

就是现在这个编辑器升级了 所有相关文件都在vendor文件夹下

JellyBool 回复 xshaitt

感觉是执行 vendor:pulish 就可以解决你的需求

xshaitt

解决了 谢谢 我自己粗心写错了

echomal

个人觉得不错哦

xiaomo1

我想问一下,在控制器怎么获取文本的值,我需要存入数据库,只能使用事件监听吗?

JellyBool 回复 xiaomo1

一样使用 request 获取吧

xiaomo1 回复 JellyBool

request获取不了,只能获取我Input的数据

JeffcottLu

教主,为什么我这边会连着

标签一起入到库里,因为这个标签,所以报错“Resource interpreted as Document but transferred with MIME type application/json”,导致图片不能上传成功

xshaitt

laravel 根目录下找到composer.json , 在 require 中
添加”stevenyangecho/laravel-u-editor”: “~1.4”
命令行执行 composer install
打开框架下config目录中 app.php 文件,在 providers
下添加 Stevenyangecho\UEditor\UEditorServiceProvider::class
执行php artisan vendor:publish
执行完后会public 目录下会新增 laravel-u-editor目录,config中会新增ueditorupload.php 文件

xshaitt

执行public的步骤:
`$ php artisan vendor:publish

Which provider or tag’s files would you like to publish?:
[0 ] Publish files from all providers and tags listed below9
m
[1 ] Provider: Fideloper\Proxy\TrustedProxyServiceProvider

[2 ] Provider: Illuminate\Mail\MailServiceProvider
[3 ] Provider: Illuminate\Notifications\NotificationServic
eProvider
[4 ] Provider: Illuminate\Pagination\PaginationServiceProv
ider
[5 ] Provider: Laracasts\Flash\FlashServiceProvider
[6 ] Provider: Laravel\Tinker\TinkerServiceProvider
[7 ] Provider: Overtrue\LaravelUEditor\UEditorServiceProvi
der
[8 ] Tag: assets
[9 ] Tag: config
[10] Tag: laravel-mail
[11] Tag: laravel-notifications
[12] Tag: laravel-pagination
[13] Tag: resources

7
7

Copied File [\vendor\overtrue\laravel-ueditor\src\config\ueditor.
php] To [\config\ueditor.php]
Copied Directory [\vendor\overtrue\laravel-ueditor\src\assets\ued
itor] To [\public\vendor\ueditor]
Copied Directory [\vendor\overtrue\laravel-ueditor\src\views]9
m To [\resources\views\vendor\ueditor]
Copied Directory [\vendor\overtrue\laravel-ueditor\src\translatio
ns] To [\resources\lang\vendor\ueditor]
Publishing complete.
`
执行完毕之后就可以解决问题了

leekyy

教主,我这边按照readme和视频一步一步做的,最后js报这个错 ‘请求后台配置项http错误,上传功能将不能正常使用!’

JellyBool 回复 leekyy

apache 或者 nginx 的重写规则没配置好