PHPackages                             it-devgroup/flysystem-google-storage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. it-devgroup/flysystem-google-storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

it-devgroup/flysystem-google-storage
====================================

Flysystem adapter for Google Cloud Storage

7.2.2(6y ago)13.8k1MITPHPPHP &gt;=5.5.0

Since Oct 16Pushed 6y agoCompare

[ Source](https://github.com/it-devgroup/flysystem-google-cloud-storage)[ Packagist](https://packagist.org/packages/it-devgroup/flysystem-google-storage)[ RSS](/packages/it-devgroup-flysystem-google-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (26)Used By (1)

flysystem-google-cloud-storage
==============================

[](#flysystem-google-cloud-storage)

A Google Cloud Storage adapter for [flysystem](https://github.com/thephpleague/flysystem) - a PHP filesystem abstraction.

Installation
------------

[](#installation)

```
composer require it-devgroup/flysystem-google-storage
```

Integrations
------------

[](#integrations)

Want to get started quickly? Check out some of these integrations:

- Laravel -

Usage
-----

[](#usage)

```
use Google\Cloud\Storage\StorageClient;
use League\Flysystem\Filesystem;
use ItDevgroup\Flysystem\GoogleStorage\GoogleStorageAdapter;

/**
 * The credentials will be auto-loaded by the Google Cloud Client.
 *
 * 1. The client will first look at the GOOGLE_APPLICATION_CREDENTIALS env var.
 *    You can use ```putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');``` to set the location of your credentials file.
 *
 * 2. The client will look for the credentials file at the following paths:
 * - windows: %APPDATA%/gcloud/application_default_credentials.json
 * - others: $HOME/.config/gcloud/application_default_credentials.json
 *
 * If running in Google App Engine, the built-in service account associated with the application will be used.
 * If running in Google Compute Engine, the built-in service account associated with the virtual machine instance will be used.
 */

$storageClient = new StorageClient([
    'projectId' => 'your-project-id',
]);
$bucket = $storageClient->bucket('your-bucket-name');

$adapter = new GoogleStorageAdapter($storageClient, $bucket);

$filesystem = new Filesystem($adapter);

/**
 * The credentials are manually specified by passing in a keyFilePath.
 */

$storageClient = new StorageClient([
    'projectId' => 'your-project-id',
    'keyFilePath' => '/path/to/service-account.json',
]);
$bucket = $storageClient->bucket('your-bucket-name');

$adapter = new GoogleStorageAdapter($storageClient, $bucket);

$filesystem = new Filesystem($adapter);

// write a file
$filesystem->write('path/to/file.txt', 'contents');

// update a file
$filesystem->update('path/to/file.txt', 'new contents');

// read a file
$contents = $filesystem->read('path/to/file.txt');

// check if a file exists
$exists = $filesystem->has('path/to/file.txt');

// delete a file
$filesystem->delete('path/to/file.txt');

// rename a file
$filesystem->rename('filename.txt', 'newname.txt');

// copy a file
$filesystem->copy('filename.txt', 'duplicate.txt');

// delete a directory
$filesystem->deleteDir('path/to/directory');

// see http://flysystem.thephpleague.com/api/ for full list of available functionality
```

Google Storage specifics
------------------------

[](#google-storage-specifics)

When using a custom storage uri the bucket name will not prepended to the file path.

```
$storageClient = new StorageClient([
    'projectId' => 'your-project-id',
]);
$bucket = $storageClient->bucket('your-bucket-name');
$adapter = new GoogleStorageAdapter($storageClient, $bucket);

// uri defaults to "https://storage.googleapis.com"
$filesystem = new Filesystem($adapter);
$filesystem->getUrl('path/to/file.txt');
// "https://storage.googleapis.com/your-bucket-name/path/to/file.txt"

// set custom storage uri
$adapter->setStorageApiUri('http://example.com');
$filesystem = new Filesystem($adapter);
$filesystem->getUrl('path/to/file.txt');
// "http://example.com/path/to/file.txt"

// You can also prefix the file path if needed.
$adapter->setStorageApiUri('http://example.com');
$adapter->setPathPrefix('extra-folder/another-folder/');
$filesystem = new Filesystem($adapter);
$filesystem->getUrl('path/to/file.txt');
// "http://example.com/extra-folder/another-folder/path/to/file.txt"
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 55.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~130 days

Total

23

Last Release

2499d ago

Major Versions

2.0.0-RC1 → 3.0.02016-09-26

3.0.4 → 4.0.02017-01-03

4.0.2 → 5.0.02017-04-03

5.0.3 → 6.0.02018-01-08

6.0.0 → 7.0.02018-02-07

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

3.0.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/92de536ed594c6be4260fea058f064d39e6469361caab16edb28cdfa83980294?d=identicon)[it-devgroup](/maintainers/it-devgroup)

---

Top Contributors

[![matthewgoslett](https://avatars.githubusercontent.com/u/1571743?v=4)](https://github.com/matthewgoslett "matthewgoslett (54 commits)")[![it-devgroup](https://avatars.githubusercontent.com/u/35729675?v=4)](https://github.com/it-devgroup "it-devgroup (13 commits)")[![zoidyzoidzoid](https://avatars.githubusercontent.com/u/2572493?v=4)](https://github.com/zoidyzoidzoid "zoidyzoidzoid (7 commits)")[![nicja](https://avatars.githubusercontent.com/u/2102143?v=4)](https://github.com/nicja "nicja (3 commits)")[![andris-sevcenko](https://avatars.githubusercontent.com/u/1891118?v=4)](https://github.com/andris-sevcenko "andris-sevcenko (2 commits)")[![cedricziel](https://avatars.githubusercontent.com/u/418970?v=4)](https://github.com/cedricziel "cedricziel (2 commits)")[![TerraSkye](https://avatars.githubusercontent.com/u/5426161?v=4)](https://github.com/TerraSkye "TerraSkye (2 commits)")[![bertuss](https://avatars.githubusercontent.com/u/2698961?v=4)](https://github.com/bertuss "bertuss (2 commits)")[![Rkallenkoot](https://avatars.githubusercontent.com/u/3198607?v=4)](https://github.com/Rkallenkoot "Rkallenkoot (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![sharif9876](https://avatars.githubusercontent.com/u/7621821?v=4)](https://github.com/sharif9876 "sharif9876 (1 commits)")[![shaunthegeek](https://avatars.githubusercontent.com/u/4971414?v=4)](https://github.com/shaunthegeek "shaunthegeek (1 commits)")[![Tobiasartz](https://avatars.githubusercontent.com/u/1214701?v=4)](https://github.com/Tobiasartz "Tobiasartz (1 commits)")[![martianoff](https://avatars.githubusercontent.com/u/7222812?v=4)](https://github.com/martianoff "martianoff (1 commits)")[![axeldpz](https://avatars.githubusercontent.com/u/19974349?v=4)](https://github.com/axeldpz "axeldpz (1 commits)")[![ilyas-hu](https://avatars.githubusercontent.com/u/7474355?v=4)](https://github.com/ilyas-hu "ilyas-hu (1 commits)")[![jameslkingsley](https://avatars.githubusercontent.com/u/11015784?v=4)](https://github.com/jameslkingsley "jameslkingsley (1 commits)")[![jorisvaesen](https://avatars.githubusercontent.com/u/4093781?v=4)](https://github.com/jorisvaesen "jorisvaesen (1 commits)")[![kainxspirits](https://avatars.githubusercontent.com/u/5594710?v=4)](https://github.com/kainxspirits "kainxspirits (1 commits)")[![albertborsos](https://avatars.githubusercontent.com/u/7307145?v=4)](https://github.com/albertborsos "albertborsos (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/it-devgroup-flysystem-google-storage/health.svg)

```
[![Health](https://phpackages.com/badges/it-devgroup-flysystem-google-storage/health.svg)](https://phpackages.com/packages/it-devgroup-flysystem-google-storage)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[league/flysystem-google-cloud-storage

Google Cloud Storage adapter for Flysystem.

2316.7M45](/packages/league-flysystem-google-cloud-storage)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
