Skip to content

Commit 4a236f0

Browse files
committed
2.0版本提交
0 parents  commit 4a236f0

13 files changed

+831
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
phpunit.phar
3+
/vendor
4+
composer.phar
5+
composer.lock
6+
*.project
7+
.idea/

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Jens Segers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
laravel-admin large-file-upload extension
2+
======
3+
4+
本扩展包是基于peinhu的[AetherUpload-Laravel](https://github.com/peinhu/AetherUpload-Laravel)针对[laravel-admin](https://github.com/z-song/laravel-admin)开发的大文件上传工具,
5+
直接用于Form组件。当前版本2.0为laravel-admin 1.6以上。
6+
7+
1,安装:
8+
````
9+
composer require dianwoung/large-file-upload
10+
````
11+
2,发布AetherUpload-laravel的静态资源:
12+
````
13+
php artisan aetherupload:publish
14+
````
15+
3,上传文件配置信息在config/aetherupload.php文件中修改(详细信息请参考说明文档)
16+
17+
4,发布本扩展包的静态资源:
18+
````
19+
php artisan vendor:publish --tag=large-file-upload
20+
````
21+
5,注册进laravel-admin,在app/Admin/bootstrap.php中添加以下代码:
22+
````
23+
Encore\Admin\Form::extend('largefile', \Encore\LargeFileUpload\LargeFileField::class);
24+
````
25+
6,在控制器中直接调用就可以了:
26+
````
27+
$form->largefile('ColumnName', 'LabelName');
28+
````
29+
新的2.0版本的更新
30+
---
31+
1,支持了分组的配置(不填的话,默认file分组)
32+
````
33+
$form->largefile('ColumnName', 'LabelName')->group('groupName');
34+
````
35+
2,编辑状态下文件按钮会显示当前的文件名
36+
37+
3,依赖包AetherUpload-Laravel更新到了2.0版本
38+
39+
后续会加入七牛云直传的支持
40+
41+
效果如图:
42+
43+
基本样式
44+
45+
![](preview.png)
46+
47+
上传中
48+
![](onload.png)
49+
50+

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "dianwoung/large-file-upload",
3+
"description": "An extension of laravel-admin for uploading large files",
4+
"type": "library",
5+
"keywords": ["laravel-admin", "extension"],
6+
"homepage": "https://github.com/Dianwoung/large-file-upload",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Dian Wang",
11+
"email": "[email protected]"
12+
}
13+
],
14+
"require": {
15+
"php": ">=7.0.0",
16+
"encore/laravel-admin": "~1.6",
17+
"peinhu/aetherupload-laravel": "~2.0"
18+
},
19+
"require-dev": {
20+
"phpunit/phpunit": "~6.0"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"Encore\\LargeFileUpload\\": "src/"
25+
}
26+
},
27+
"extra": {
28+
"laravel": {
29+
"providers": [
30+
"Encore\\LargeFileUpload\\LargeFileUploadServiceProvider"
31+
]
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)