2017 © Pedro Peláez
 

library laravel-ueditor

UEditor integration for Laravel.

image

ty666/laravel-ueditor

UEditor integration for Laravel.

  • Monday, March 19, 2018
  • by ty666
  • Repository
  • 1 Watchers
  • 0 Stars
  • 32 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 54 Forks
  • 0 Open issues
  • 18 Versions
  • 23 % Grown

The README.md

Laravel-UEditor

UEditor integration for Laravel 5., (*1)

使用

视频教程:https://www.laravist.com/series/awesome-laravel-packages/episodes/7, (*2)

安装

$ composer require "overtrue/laravel-ueditor:~1.0"

配置

  1. 添加下面一行到 config/app.phpproviders 部分:, (*3)

    Overtrue\LaravelUEditor\UEditorServiceProvider::class,
    
  2. 发布配置文件与资源, (*4)

    $ php artisan vendor:publish --provider='Overtrue\LaravelUEditor\UEditorServiceProvider'
    
  3. 模板引入编辑器, (*5)

    这行的作用是引入编辑器需要的 css,js 等文件,所以你不需要再手动去引入它们。, (*6)

    @include('vendor.ueditor.assets')
    
  4. 编辑器的初始化, (*7)

    
    
    
    
    
    
    
    
    
    

说明

  1. 5.4+ 请不要忘记 php artisan storage:link
  2. 如果你使用的是 laravel 5.3 以下版本,请先创建软链接: shell # 请在项目根目录执行以下命令 $ ln -s `pwd`/storage/app/public `pwd`/public/storage
  3. config/ueditor.php 配置 disk'public' 情况下,上传路径在:public/uploads/ 下,确认该目录存在并可写。
  4. 如果要修改上传路径,请在 config/ueditor.php 里各种类型的上传路径,但是都在 public 下。
  5. 请在 .env 中正确配置 APP_URL 为你的当前域名,否则可能上传成功了,但是无法正确显示。

七牛支持

如果你想使用七牛云储存,需要进行下面几个简单的操作:, (*8)

1.安装和配置 laravel-filesystem-qiniu, (*9)

2.配置 config/ueditor.phpdiskqiniu:, (*10)

'disk' => 'qiniu'

3.剩下时间打局 LOL,已经完事了。, (*11)

七牛的 access_keysecret_key 可以在这里找到:https://portal.qiniu.com/user/key ,在创建 bucket (空间)的时候,推荐大家都使用公开的空间。, (*12)

事件

你肯定有一些朋友肯定会有一些比较特殊的场景,那么你可以使用本插件提供的事件来支持:, (*13)

请按照 Laravel 事件的文档来使用: https://laravel.com/docs/5.4/events#registering-events-and-listeners, (*14)

上传中事件

Overtrue\LaravelUEditor\Events\Uploading, (*15)

在保存文件之前,你可以拿到一些信息:, (*16)

  • $event->file 这是请求的已经上传的文件对象,Symfony\Component\HttpFoundation\File\UploadedFile 实例。
  • $event->filename 这是即将存储时用的新文件名
  • $event->config 上传配置,数组。

你可以在本事件监听器返回值,返回值将替换 $filename 作为存储文件名。, (*17)

上传完成事件

Overtrue\LaravelUEditor\Events\Uploaded, (*18)

它有两个属性:, (*19)

  • $event->file 与 Uploading 一样,上传的文件
  • $event->result 上传结构,数组,包含以下信息:, (*20)

    'state' => 'SUCCESS',
    'url' => 'http://xxxxxx.qiniucdn.com/xxx/xxx.jpg',
    'title' => '文件名.jpg',
    'original' => '上传时的源文件名.jpg',
    'type' => 'jpg',
    'size' => 17283,
    

你可以监听此事件用于一些后续处理任务,比如记录到数据库。, (*21)

License

MIT, (*22)

The Versions

19/03 2018

dev-master

9999999-dev

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

19/03 2018

1.3.2

1.3.2.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

19/03 2018

1.3.1

1.3.1.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

19/03 2018

1.3

1.3.0.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

04/09 2017

1.2.8

1.2.8.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

17/07 2017

1.2.7

1.2.7.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

04/07 2017

1.2.6

1.2.6.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

26/06 2017

1.2.5

1.2.5.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

25/06 2017

1.2.4

1.2.4.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

14/06 2017

2.0.3

2.0.3.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

14/06 2017

2.0.1

2.0.1.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

14/06 2017

2.0.2

2.0.2.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

26/05 2017

1.2.3

1.2.3.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

22/05 2017

1.2.2

1.2.2.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

22/05 2017

1.2.1

1.2.1.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

17/04 2017

1.2.0

1.2.0.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue

26/02 2017

1.1.0

1.1.0.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar overtrue

18/11 2015

1.0.0

1.0.0.0

UEditor integration for Laravel.

  Sources   Download

MIT

The Development Requires

by Avatar overtrue