grandwebdesign/digitalocean-spaces-laravel
最新稳定版本:1.2.2
Composer 安装命令:
composer require grandwebdesign/digitalocean-spaces-laravel
包简介
This package will help uploading and removing assets to digitalocean spaces
README 文档
README
This package provides easy integration and management of DigitalOcean Spaces in Laravel applications.
Requirements
- PHP >= 8.1
- Laravel >= 10.0
Installation
To install the package via Composer:
composer require grandwebdesign/digitalocean-spaces-laravel
Configuration
Once you've installed the package, set the following environment variables in your .env file:
DO_ACCESS_KEY_ID= DO_SECRET_ACCESS_KEY= DO_DEFAULT_REGION= DO_BUCKET= DO_CDN_ENDPOINT= DO_ENDPOINT= DO_FOLDER=
Note on DO_FOLDER: This variable can remain empty if you want to upload files to the root directory. Otherwise, specify a folder name, such as "uploads", so all files will be uploaded to the /uploads/ path.
If you want to compress the image files as you upload you also need to specify your TinyPNG API key to your .env file.
TINIFY_API_KEY=
Usage
To upload a file
use Grandwebdesign\DigitaloceanSpacesLaravel\DigitaloceanSpaces; $digitaloceanSpace = new DigitaloceanSpaces( file: $this->file('image'), folder: '', fileName: 'filename.png' ); $fileName = $digitaloceanSpace->upload();
To remove a file
use Grandwebdesign\DigitaloceanSpacesLaravel\DigitaloceanSpaces; $digitaloceanSpace = new DigitaloceanSpaces( file: 'filename.png', ); $fileName = $digitaloceanSpace->delete();
统计信息
- 总下载量: 59
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-18