quangtrung38/trendzycloud

上传到Trendzy Cloud

v1.0 2020-09-23 09:59 UTC

This package is auto-updated.

Last update: 2024-09-24 16:55:53 UTC


README

API上传到TrendzyCloud

使用composer安装.

使用Laravel安装

通过composer安装

composer require quangtrung38/trendzycloud
php artisan vendor:publish --provider="quangtrung38\trendzycloud\TrendzyCloudServiceProvider"

将图片上传到云存储

use quangtrung38\trendzycloud\TrendzyCloud;

// upload

$data = [
    'file'   => $file, // input file
    'userId' => 1,
];

$trendzyCloud = new TrendzyCloud();
$result = $cloud->uploadFile($data);

$result = $cloud->uploadVideo($data);

$result = $cloud->uploadDocument($data);


// delete

$data = [
    'key'   => '5f6c4919e67b5',
    'userId' => \Auth::id(),
];

$cloud = new TrendzyCloud;
$result = $cloud->deleteImage($data);

$result = $cloud->deleteVideo($data);

$result = $cloud->deleteDocument($data);