Google Cloud Storage

Installation

composer require league/flysystem-google-cloud-storage:^3.0

Notice

It’s important to know this adapter does not fully comply with the adapter contract. The difference(s) is/are:

  • Visibility retrieving for unknown files always resolved to private.

Usage

<?php

use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter;
use League\Flysystem\Filesystem;
use Google\Cloud\Storage\StorageClient;

include __DIR__.'/vendor/autoload.php';

$storageClient = new StorageClient($clientOptions);
$bucket = $storageClient->bucket('your-bucket-name');

return new GoogleCloudStorageAdapter($bucket, 'optional-prefix');