2017 © Pedro Peláez
 

library laravel-u-editor

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

image

stevenyangecho/laravel-u-editor

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  • Wednesday, June 21, 2017
  • by stevenyangecho
  • Repository
  • 21 Watchers
  • 264 Stars
  • 23,013 Installations
  • JavaScript
  • 7 Dependents
  • 0 Suggesters
  • 72 Forks
  • 25 Open issues
  • 14 Versions
  • 16 % Grown

The README.md

Laravel 5 UEditor

UEditor 是由百度web前端研发部开发所见即所得富文本web编辑器, (*1)

此包为laravel5的支持,新增多语言配置,可自由部署前端代码,默认基于 UEditor 1.4.3.3, (*2)

UEditor 前台文件完全无修改,可自由gulp等工具部署到生产环境, (*3)

根据系统的config.app.locale自动切换多语言. 暂时只支持 en,zh_CN,zh_TW, (*4)

支持本地和七牛云存储,默认为本地上传 public/uploads, (*5)

ChangeLog

v1.4.5, (*6)

增加laravel的storage的支持, (*7)

增加阿里云存储的支持, (*8)

增加Lumen5的provider支持, (*9)

~~v1.4.3 (bug已删除)~~, (*10)

1.4.0 版 支持 laravel5.3 更新百度 UEditor 1.4.3.3, (*11)

1.3.0 版 改变服务器请求路由 为 /laravel-u-editor-server/server 老版本升级,需要 更改 public/ueditor.config.js, (*12)

        , serverUrl: "/laravel-u-editor-server/server"

1.2.5 版 增加对Laravel5.* 的支持,更新百度 UEditor 1.4.3.1, (*13)

1.2 版 增加对Laravel5.1 的支持,修改一些说明, (*14)

1.1 版 增加七牛云存储的支持, (*15)

重要提示

有些同学配置总是不成功,除了一般设置,权限等基础问题,很大的可能是 middleware和 csrf 没配置好. 因为这两点对于服务器的安全至关重要,因此都是必须配置正确的,否则无法运行. 如何配置需要一定基础,对于看完且理解L5官方文档的同学,应该都有此基础., (*16)

Installation

PHP 5.4+ , and Composer are required., (*17)

To get the latest version of Laravel Exceptions, simply add the following line to the require block of your composer.json file:, (*18)

"stevenyangecho/laravel-u-editor": "~1.4"

You'll then need to run composer install or composer update to download it and have the autoloader updated., (*19)

Once Laravel Exceptions is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key., (*20)

  • 'Stevenyangecho\UEditor\UEditorServiceProvider'

If Lumen, (*21)

  • $app->register(Stevenyangecho\UEditor\LumenUEditorServiceProvider);

then run, (*22)

  • php artisan vendor:publish

配置

For Laravel, (*23)

若以上安装没问题,自定义项目配置文件会在 config/UEditorUpload.php (会自动生成), (*24)

    'core' => [
        'route' => [
            'middleware' => 'auth',
        ],
    ],

middleware 相当重要,请根据自己的项目设置,比如如果在后台使用,请设置为后台的auth middleware. 如果是单纯本机测试,请将 // 'middleware' => 'auth', 直接注释掉,如果留 'middleware'=>''空值,会产生bug,原因不详., (*25)

所有UEditor 的官方资源,会放在 public/laravel-u-editor/ ,可以根据自己的需求,更改., (*26)

For Lumen, (*27)

如需要配置config 请将config/UEditorUpload.php 拷贝到项目config目录中 再配置, (*28)

Usage

in your <head> block just put, (*29)

@include('UEditor::head');

it will require assets., (*30)

if need,u can change the resources\views\vendor\UEditor\head.blade.php to fit your customization ., (*31)

ok,all done.just use the UEditor., (*32)

<!-- 加载编辑器的容器 -->
<script id="container" name="content" type="text/plain">
    这里写你的初始化内容
</script>

<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container');
        ue.ready(function() {
        ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.    
    });
</script>

The detail useage Please see http://ueditor.baidu.com, (*33)

TODO

  1. 跨域上传

License

Laravel 5 UEditor is licensed under The MIT License (MIT)., (*34)

The Versions

21/06 2017

dev-master

9999999-dev

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/06 2017

v1.4.2

1.4.2.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

04/02 2017

v1.4.1

1.4.1.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

06/11 2016

v1.4.0

1.4.0.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

22/01 2016

v1.3.0

1.3.0.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/01 2016

v1.2.5

1.2.5.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/01 2016

v1.2.2

1.2.2.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/01 2016

v1.2.3

1.2.3.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

14/10 2015

v1.2.1

1.2.1.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

13/06 2015

v1.2.0

1.2.0.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

12/04 2015

v1.1.2

1.1.2.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/02 2015

v1.1.1

1.1.1.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/02 2015

v1.1.0

1.1.0.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang

21/02 2015

v1.2.4

1.2.4.0

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

  Sources   Download

MIT

The Requires

 

by Steven Yang

laravel ueditor laravel-u-editor laravel5 web text editor stevenyangecho steven yang