digiservnet / flysystem-aws-s3-v3-minio
Flysystem adapter for the AWS S3 SDK v3.x, forked for minio support
2.0.0
2022-02-13 23:38 UTC
Requires
- php: >=5.5.0|^8.0
- aws/aws-sdk-php: ^3.0.0
- league/flysystem: ^3.0.0
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: ~1.0.1
- phpspec/phpspec: ^2.0.0
README
This is a Flysystem adapter for the aws-sdk-php v3. Forked to support minio. (https://minio.io)
Installation
composer require digiservnet/flysystem-aws-s3-v3-minio
Bootstrap
<?php use Aws\S3\S3Client; use League\Flysystem\AwsS3v3\AwsS3Adapter; use League\Flysystem\Filesystem; include __DIR__ . '/vendor/autoload.php'; $client = new S3Client([ 'credentials' => [ 'key' => 'your-key', 'secret' => 'your-secret' ], 'region' => 'your-region', 'version' => 'latest|version', ]); $options = [ 'override_visibility_on_copy' => true ]; $adapter = new AwsS3Adapter($client, 'your-bucket-name', '', $options); $filesystem = new Filesystem($adapter);
Laravel
config/filesystems.php
'site' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'endpoint' => env('AWS_ENDPOINT'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
'use_path_style_endpoint' => true,
'options' => [
'override_visibility_on_copy' => 'private',
]
]