All Projects → overtrue → Laravel Ueditor

overtrue / Laravel Ueditor

UEditor integration for Laravel.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Laravel Ueditor

Transit
Easy file uploading and downloading for Laravel 5.
Stars: ✭ 5 (-98.72%)
Mutual labels:  laravel, upload
Laravel Guided Image
Simplified and ready image manipulation for Laravel through intervention image.
Stars: ✭ 32 (-91.84%)
Mutual labels:  laravel, upload
Laravel Imageup
Auto Image & file upload, resize and crop for Laravel eloquent model using Intervention image
Stars: ✭ 646 (+64.8%)
Mutual labels:  laravel, upload
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+1109.95%)
Mutual labels:  laravel, upload
Upload
Ajax Upload Large File Support jQuery-File-Upload, FileApi, Plupload, Dropzone Support framework Laravel 5
Stars: ✭ 76 (-80.61%)
Mutual labels:  laravel, upload
Kbframe
一款基于Laravel框架开发的现代化二次开发框架,是高性能,高效率,高质量的企业级开发框架,具有驱动领域,敏捷开发,轻易上手,高内聚低耦合,开箱即用等特点。
Stars: ✭ 47 (-88.01%)
Mutual labels:  laravel, upload
Aetherupload Laravel
A Laravel package to upload large files 上传大文件的Laravel扩展包
Stars: ✭ 835 (+113.01%)
Mutual labels:  laravel, upload
Laravel Filemanager
Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.
Stars: ✭ 1,688 (+330.61%)
Mutual labels:  laravel, upload
Laravel Imageupload
Upload image using Laravel's build in function and resize it automatically.
Stars: ✭ 73 (-81.38%)
Mutual labels:  laravel, upload
Laravel Simple Uploader
Simple file uploader for Laravel 5.
Stars: ✭ 59 (-84.95%)
Mutual labels:  laravel, upload
Laravel Filemanager Example 5.3
Demo integration for laravel-filemanager (https://github.com/UniSharp/laravel-filemanager).
Stars: ✭ 100 (-74.49%)
Mutual labels:  laravel, upload
Youtube
Upload a video to a single YouTube channel with Laravel 5.
Stars: ✭ 143 (-63.52%)
Mutual labels:  laravel, upload
Google Maps
Collection of Google Maps API Web Services for Laravel
Stars: ✭ 380 (-3.06%)
Mutual labels:  laravel
Polr
🚡 A modern, powerful, and robust URL shortener
Stars: ✭ 4,147 (+957.91%)
Mutual labels:  laravel
Laravel Report Generator
Rapidly Generate Simple Pdf, CSV, & Excel Report Package on Laravel
Stars: ✭ 380 (-3.06%)
Mutual labels:  laravel
Secure Headers
PHP Secure Headers
Stars: ✭ 379 (-3.32%)
Mutual labels:  laravel
I Educar
Lançando o maior software livre de educação do Brasil!
Stars: ✭ 388 (-1.02%)
Mutual labels:  laravel
Crater
Open Source Invoicing Solution for Individuals & Businesses
Stars: ✭ 4,897 (+1149.23%)
Mutual labels:  laravel
Coastercms
The repository for Coaster CMS (coastercms.org), a full featured, Laravel based Content Management System
Stars: ✭ 380 (-3.06%)
Mutual labels:  laravel
Laravel Websockets
Websockets for Laravel. Done right.
Stars: ✭ 4,157 (+960.46%)
Mutual labels:  laravel

Laravel-UEditor

UEditor integration for Laravel 5.

使用

视频教程:https://www.laravist.com/series/awesome-laravel-packages/episodes/7

安装

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

配置

  1. 添加下面一行到 config/app.phpproviders 部分:

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

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

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

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

    <!-- 实例化编辑器 -->
    <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>
    

说明

  1. 5.4+ 请不要忘记 php artisan storage:link
  2. 如果你使用的是 laravel 5.3 以下版本,请先创建软链接:
    # 请在项目根目录执行以下命令
    $ 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 为你的当前域名,否则可能上传成功了,但是无法正确显示。

七牛支持

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

1.安装和配置 laravel-filesystem-qiniu

2.配置 config/ueditor.phpdiskqiniu:

'disk' => 'qiniu'

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

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

事件

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

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

上传中事件

Overtrue\LaravelUEditor\Events\Uploading

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

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

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

上传完成事件

Overtrue\LaravelUEditor\Events\Uploaded

它有两个属性:

  • $event->file 与 Uploading 一样,上传的文件

  • $event->result 上传结构,数组,包含以下信息:

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

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

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].