定制 probablyrational/wasabi-storage 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

probablyrational/wasabi-storage

最新稳定版本:v1.4.0

Composer 安装命令:

composer require probablyrational/wasabi-storage

包简介

A wasabi storage driver for Laravel

README 文档

README

As of Laravel 8, laravel not supports s3 compatible backends natively so there is no need to use this package. All you need to do is update your filesystems.php config file to include a endpoint on a s3 driver.

        'wasabi' => [
            'driver' => 's3',
            'key' => env('WASABI_ACCESS_KEY_ID'),
            'secret' => env('WASABI_SECRET_ACCESS_KEY'),
            'region' => env('WASABI_DEFAULT_REGION', 'eu-central-1'),
            'bucket' => env('WASABI_BUCKET'),
            'endpoint' => env('WASABI_ENDPOINT', 'https://s3.eu-central-1.wasabisys.com/'),
        ],

This package will remain on github and packagist for use with older laravel versions.

wasabi-storage

A Wasabi storage driver for Laravel.

This packages uses the AWS S3 storage driver but changes it to use Wasabi endpoints. It should work exactly the same way and support all the same features.

Installation

composer require probablyrational/wasabi-storage

If you are on Laravel 5.4 or earlier, then register the service provider in app.php

'providers' => [
    // ...
    ProbablyRational\Wasabi\WasabiServiceProvider::class,
]

If you are on Laravel 5.5 or higher, composer will have registered the provider automatically for you.

Add a new disk to your filesystems.php config

'wasabi' => [
    'driver' => 'wasabi',
    'key' => env('WASABI_ACCESS_KEY_ID'),
    'secret' => env('WASABI_SECRET_ACCESS_KEY'),
    'region' => env('WASABI_DEFAULT_REGION', 'eu-central-1'),
    'bucket' => env('WASABI_BUCKET'),
    'root' => env('WASABI_ROOT', '/'),
],

Usage

$disk = Storage::disk('wasabi');

// list all files
$files = $disk->files('/');

// create a file
$disk->put('avatars/1', $fileContents);

// check if a file exists
$exists = $disk->exists('file.jpg');

// get file modification date
$time = $disk->lastModified('file1.jpg');

// copy a file
$disk->copy('old/file1.jpg', 'new/file1.jpg');

// move a file
$disk->move('old/file1.jpg', 'new/file1.jpg');

// get url to file
$url = $disk->url('folder/my_file.txt');

// Set the visibility of file to public
$disk->setVisibility('folder/my_file.txt', 'public');


// See https://laravel.com/docs/5.3/filesystem for full list of available functionality

统计信息

  • 总下载量: 33.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 21
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-01