grandwebdesign/digitalocean-spaces-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-18