Skip to content
This repository was archived by the owner on Aug 22, 2021. It is now read-only.

Commit 72744c7

Browse files
committed
Update namespace.
1 parent 62294aa commit 72744c7

9 files changed

+64
-11
lines changed

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,54 @@
1-
# Laravel-ueditor
1+
# Laravel-UEditor
22

3-
# Usage
3+
UEditor integration for Laravel 5.
4+
5+
# 使用
6+
7+
## 安装
8+
9+
```shell
10+
composer require "overtrue\laravel-ueditor"
11+
```
12+
13+
## 配置
14+
15+
1. 添加下面一行到 `config/app.php``providers` 部分:
16+
17+
```php
18+
Overtrue\LaravelUEditor\UEditorServiceProvider::class,
19+
```
20+
21+
2. 发布配置文件与资源
22+
23+
```php
24+
php artisan vendor:publish
25+
```
26+
27+
3. 模板引入编辑器
28+
29+
```php
30+
@include('vendor.ueditor.assets')
31+
```
32+
33+
4. 编辑器的初始化
34+
35+
```html
36+
<!-- 实例化编辑器 -->
37+
<script type="text/javascript">
38+
var ue = UE.getEditor('container');
39+
ue.ready(function() {
40+
ue.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
41+
});
42+
</script>
43+
@stop
44+
45+
<!-- 编辑器容器 -->
46+
<script id="container" name="content" type="text/plain"></script>
47+
```
48+
49+
# 说明
50+
51+
TODO
452

553
# License
654

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"email": "[email protected]"
99
}
1010
],
11+
"autoload": {
12+
"psr-4":{
13+
"Overtrue\\LaravelUEditor\\":"src/"
14+
}
15+
},
1116
"require": {},
1217
"require-dev": {
1318
"fabpot/php-cs-fixer": "^1.10"

src/LocalStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Exception;
1515
use Symfony\Component\Finder\Finder;
@@ -28,7 +28,7 @@ class LocalStorage implements StorageInterface
2828
*
2929
* @return mixed
3030
*
31-
* @throws \App\Services\UEditor\StoreErrorException
31+
* @throws \Overtrue\LaravelUEditor\StoreErrorException
3232
*/
3333
public function store(UploadedFile $file, $filename)
3434
{

src/QiNiuStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Symfony\Component\HttpFoundation\File\UploadedFile;
1515

src/StorageInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Symfony\Component\HttpFoundation\File\File;
1515
use Symfony\Component\HttpFoundation\File\UploadedFile;

src/StorageManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Illuminate\Http\Request;
1515
use Illuminate\Support\Manager;
@@ -106,7 +106,7 @@ public function createLocalDriver()
106106
/**
107107
* Make qiniu storage.
108108
*
109-
* @return \App\Services\UEditor\QiNiuStorage
109+
* @return \Overtrue\LaravelUEditor\QiNiuStorage
110110
*/
111111
public function createQiniuDriver()
112112
{

src/StoreErrorException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Exception;
1515

src/UEditorController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Illuminate\Http\Request;
1515
use Illuminate\Routing\Controller;

src/UEditorServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12-
namespace App\Services\UEditor;
12+
namespace Overtrue\LaravelUEditor;
1313

1414
use Illuminate\Routing\Router;
1515
use Illuminate\Support\ServiceProvider;

0 commit comments

Comments
 (0)