PHPackages                             vkovalc/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. vkovalc/flysystem-google-storage

ActiveLibrary

vkovalc/flysystem-google-storage
================================

Flysystem adapter for Google Cloud Storage

8.0.0(3y ago)03MITPHPPHP &gt;=5.5.0

Since Oct 16Pushed 3y agoCompare

[ Source](https://github.com/vkovalc/flysystem-google-cloud-storage)[ Packagist](https://packagist.org/packages/vkovalc/flysystem-google-storage)[ RSS](/packages/vkovalc-flysystem-google-storage/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (26)Used By (0)

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

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

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

[![Author](https://camo.githubusercontent.com/abd4e3e2e71081ad01ef09a60c49d70c5e0677497f38918e740703cd02605078/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40737570657262616c6973742d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/superbalist)[![Build Status](https://camo.githubusercontent.com/6c2e12c0ee201f29c109e998c52a776b9bb60bd2451eecfbce6bab3face33c64/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f537570657262616c6973742f666c7973797374656d2d676f6f676c652d636c6f75642d73746f726167652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Superbalist/flysystem-google-cloud-storage)[![StyleCI](https://camo.githubusercontent.com/f3c57a7b839651e0237c998546ee6c8c2dce0092911550e17b012348e0f2b5d9/68747470733a2f2f7374796c6563692e696f2f7265706f732f34343337303834332f736869656c643f6272616e63683d7374796c652d6369)](https://styleci.io/repos/44370843)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/c73eb652ba88b2ebcbf8b17dec8c6e2ab77b8006472dfb2d2eab51fabcaaeaa4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737570657262616c6973742f666c7973797374656d2d676f6f676c652d73746f726167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/flysystem-google-storage)[![Total Downloads](https://camo.githubusercontent.com/24e934fe0671736d591c103f1222609a2373416c4ab82c1ed228184f4151bcbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737570657262616c6973742f666c7973797374656d2d676f6f676c652d73746f726167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/flysystem-google-storage)

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

[](#installation)

```
composer require superbalist/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 Superbalist\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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 60.7% 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 ~104 days

Recently: every ~332 days

Total

24

Last Release

1459d ago

Major Versions

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

7.2.2 → 8.0.02022-05-10

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/b4c3aa8d6178a58fcb6bad2c460feafca15a03f717c7a1c33fb3d254bf072018?d=identicon)[vkovalc](/maintainers/vkovalc)

---

Top Contributors

[![matthewgoslett](https://avatars.githubusercontent.com/u/1571743?v=4)](https://github.com/matthewgoslett "matthewgoslett (54 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 (4 commits)")[![cedricziel](https://avatars.githubusercontent.com/u/418970?v=4)](https://github.com/cedricziel "cedricziel (2 commits)")[![bertuss](https://avatars.githubusercontent.com/u/2698961?v=4)](https://github.com/bertuss "bertuss (2 commits)")[![TerraSkye](https://avatars.githubusercontent.com/u/5426161?v=4)](https://github.com/TerraSkye "TerraSkye (2 commits)")[![andris-sevcenko](https://avatars.githubusercontent.com/u/1891118?v=4)](https://github.com/andris-sevcenko "andris-sevcenko (2 commits)")[![albertborsos](https://avatars.githubusercontent.com/u/7307145?v=4)](https://github.com/albertborsos "albertborsos (1 commits)")[![nasatome](https://avatars.githubusercontent.com/u/18271791?v=4)](https://github.com/nasatome "nasatome (1 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)")[![tpetry](https://avatars.githubusercontent.com/u/315686?v=4)](https://github.com/tpetry "tpetry (1 commits)")[![vkovalc](https://avatars.githubusercontent.com/u/73169202?v=4)](https://github.com/vkovalc "vkovalc (1 commits)")[![michaelveltkamp](https://avatars.githubusercontent.com/u/8802578?v=4)](https://github.com/michaelveltkamp "michaelveltkamp (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)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M16.9k](/packages/laravel-framework)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M186](/packages/spatie-laravel-backup)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M785](/packages/league-flysystem-aws-s3-v3)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[unisharp/laravel-filemanager

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

2.2k3.3M73](/packages/unisharp-laravel-filemanager)

PHPackages © 2026

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