2017 © Pedro Peláez
 

library laravel-ueditor

UEditor integration for Laravel 5.2

image

eunion/laravel-ueditor

UEditor integration for Laravel 5.2

  • Tuesday, January 2, 2018
  • by demon823
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Laravel-UEditor

UEditor integration for Laravel 5. 路由缓存问题, (*1)

安装

$ composer require "eunion/laravel-ueditor:~2.0"

配置

  1. 发布配置文件与资源, (*2)

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

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

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

    
    
    
    
    
    
    
    
    
    

说明

  • 5.4+ 请不要忘记 php artisan storage:link
  • config/ueditor.php 配置 disk'public' 情况下,上传路径在:public/uploads/ 下,确认该目录存在并可写。
  • 如果要修改上传路径,请在 config/ueditor.php 里各种类型的上传路径,但是都在 public 下。
  • 请在 .env 中正确配置 APP_URL 为你的当前域名,否则可能上传成功了,但是无法正确显示。

七牛支持

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

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

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

'disk' => 'qiniu'

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

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

事件

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

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

上传中事件

Eunion\LaravelUEditor\Events\Uploading, (*13)

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

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

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

上传完成事件

Eunion\LaravelUEditor\Events\Uploaded, (*16)

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

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

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

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

License

MIT, (*20)

The Versions

02/01 2018

dev-master

9999999-dev

UEditor integration for Laravel 5.2

  Sources   Download

MIT

The Development Requires

by eunion

28/12 2017

v1.0.3

1.0.3.0

UEditor integration for Laravel 5.2

  Sources   Download

MIT

The Development Requires

by eunion

28/12 2017

v1.0.2

1.0.2.0

UEditor integration for Laravel 5.2

  Sources   Download

MIT

The Development Requires

by eunion

28/12 2017

v1.0.1

1.0.1.0

UEditor integration for Laravel 5.2

  Sources   Download

MIT

The Development Requires

by eunion

28/12 2017

v1.0.0

1.0.0.0

UEditor integration for Laravel 5.2

  Sources   Download

MIT

The Development Requires

by eunion