Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Flysystem Bundle Laravel Package

league/flysystem-bundle

View on GitHub
Deep Wiki
Context7

Cloud storage providers

One of the core feature of Flysystem is its ability to interact easily with remote filesystems, including many cloud storage providers. This bundle provides the same level of support for these cloud providers by providing corresponding adapters in the configuration.

Azure

Installation

composer require league/flysystem-azure-blob-storage

Usage

# config/packages/flysystem.yaml

flysystem:
    storages:
        users.storage:
            azure:
                client: 'azure_client_service' # The service ID of the MicrosoftAzure\Storage\Blob\BlobRestProxy instance
                container: 'container_name'
                prefix: 'optional/path/prefix'

AsyncAws S3

Installation

composer require league/flysystem-async-aws-s3

Usage

# config/packages/flysystem.yaml

flysystem:
    storages:
        users.storage:
            asyncaws:
                client: 'aws_client_service' # The service ID of the AsyncAws\S3\S3Client instance
                bucket: 'bucket_name'
                prefix: 'optional/path/prefix'

AWS SDK S3

Installation

composer require league/flysystem-aws-s3-v3

Usage

# config/packages/flysystem.yaml

flysystem:
    storages:
        users.storage:
            # visibility: public # Make the uploaded file publicly accessible in S3
            aws:
                client: 'aws_client_service' # The service ID of the Aws\S3\S3Client instance
                bucket: 'bucket_name'
                prefix: 'optional/path/prefix'
                streamReads: true

Google Cloud Storage

Installation

composer require league/flysystem-google-cloud-storage

Usage

# config/packages/flysystem.yaml
 
flysystem:
    storages:
        users.storage:
            gcloud:
                client: 'gcloud_client_service' # The service ID of the Google\Cloud\Storage\StorageClient instance
                bucket: 'bucket_name'
                prefix: 'optional/path/prefix'
                streamReads: false

DigitalOcean Spaces

The DigitalOcean Spaces are compatible with the AWS S3 API, meaning that you can use the same configuration as for a AWS storage. For example:

# config/packages/flysystem.yaml

services:
    digitalocean_spaces_client:
        class: 'AsyncAws\S3\S3Client'
        arguments:
            -
                endpoint: '%env(DIGITALOCEAN_SPACES_ENDPOINT)%'
                accessKeyId: '%env(DIGITALOCEAN_SPACES_ID)%'
                accessKeySecret: '%env(DIGITALOCEAN_SPACES_SECRET)%'

flysystem:
    storages:
        cdn.storage:
            asyncaws:
                client: 'digitalocean_spaces_client'
                bucket: '%env(DIGITALOCEAN_SPACES_BUCKET)%'

Scaleway Object Storage

The Scaleway Object Storage is compatible with the AWS S3 API, meaning that you can use the same configuration as for a AWS storage. For example:

# config/packages/flysystem.yaml

services:
    scaleway_spaces_client:
        class: 'AsyncAws\S3\S3Client'
        arguments:
            -   
                endpoint: '%env(SCALEWAY_SPACES_ENDPOINT)%'
                accessKeyId: '%env(SCALEWAY_SPACES_ID)%'
                accessKeySecret: '%env(SCALEWAY_SPACES_SECRET)%'

flysystem:
    storages:
        cdn.storage:
            asyncaws:
                client: 'scaleway_spaces_client'
                bucket: '%env(SCALEWAY_SPACES_BUCKET)%'

Cloudflare R2

The Cloudflare R2 is compatible with the AWS S3 API, meaning that you can use the same configuration as for an AWS storage. Both the regular and the async AWS Client can be used. As example:

# config/packages/flysystem.yaml

services:
    cloudflare_r2_client:
        class: 'AsyncAws\S3\S3Client'
        arguments:
            -   
                endpoint: '%env(CLOUDFLARE_R2_ENDPOINT)%'
                accessKeyId: '%env(CLOUDFLARE_R2_ID)%'
                accessKeySecret: '%env(CLOUDFLARE_R2_SECRET)%'

flysystem:
    storages:
        cdn.storage:
            asyncaws:
                client: 'cloudflare_r2_client'
                bucket: '%env(CLOUDFLARE_R2_BUCKET)%'

Cloudflare R2 does not have implemented ACL-related features yet, and thereby making use of Flysystem's move and copy methods requires configuring explicit value for visibility and setting retain_visibility to false to prevent the S3 adapter to call the GetObjectAcl command to retrieve an object's current ACL visibility, then resulting in an exception.

flysystem:
    storages:
        cdn.storage:
            # ...
            visibility: private # or public
            
            # to use the visibility as defined above instead of retaining the object's visibility, and not having to run
            # the unsupported `GetObjectAcl` command to get the object's current visibility.
            retain_visibility: false  
            # ...

Next

Interacting with FTP and SFTP servers

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui