think.studio/nova-chunked-video
最新稳定版本:3.0.3
Composer 安装命令:
composer require think.studio/nova-chunked-video
包简介
Laravel Nova field to upload big size video using chunks.
README 文档
README
Laravel Nova field to upload big size video using chunks.
Versions targeting
| Nova | Package |
|---|---|
| V1-3 | V1 |
| V4 | V2-3 |
Installation
You can install the package via composer:
composer require think.studio/nova-chunked-video # optional publish configs php artisan vendor:publish --provider="NovaChunkedVideo\FieldServiceProvider" --tag="config"
Usage
\NovaChunkedVideo\ChunkedVideo::make( 'Video', 'big_video' ) ->acceptedTypes( 'video/mp4' ) ->disk( 'my_private_disk' ) ->store( function ( $filePath, $disk, $model, $attribute, $request ) { // something like delete old video and save new $model->big_video = $filePath; $model->save(); // WARNING: response should return url. return Storage::disk($disk)->url($filePath); } ) ->preview( function ($value, $disk, $model ) { return Storage::disk($disk)->url($value); } ) ->download(function (NovaRequest $request, Model $model, ?string $disk, $value) { return $value ? Storage::disk($disk)->download($value) : null; }) ->delete(function (NovaRequest $request, $model, ?string $disk, $value) { if ($value) { Storage::disk($disk)->delete($value); } return true; }) ->help( 'Usually a large video: 0.5-2GB. Max size 3GB' ),
Credits
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-16
