PHPackages                             it-devgroup/laravel-google-cloud-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/laravel-google-cloud-storage

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

it-devgroup/laravel-google-cloud-storage
========================================

A Google Cloud Storage filesystem for Laravel

2.2.3(5y ago)13.8kMITPHPPHP &gt;=5.5.9

Since Sep 27Pushed 5y agoCompare

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

READMEChangelogDependencies (5)Versions (17)Used By (0)

laravel-google-cloud-storage
============================

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

A Google Cloud Storage filesystem for Laravel.

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

[](#installation)

```
composer require it-devgroup/laravel-google-cloud-storage
```

If you are on Laravel 5.4 or earlier, then register the service provider in app.php

```
'providers' => [
    // ...
    ItDevgroup\LaravelGoogleCloudStorage\GoogleCloudStorageServiceProvider::class,
]
```

If you are on Laravel 5.5 or higher, composer will have registered the provider automatically for you.

Add a new disk to your `filesystems.php` config

```
'gcs' => [
    'driver' => 'gcs',
    'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'),
    'key_file' => env('GOOGLE_CLOUD_KEY_FILE', null), // optional: /path/to/service-account.json
    'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET', 'your-bucket'),
    'path_prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', null), // optional: /default/path/to/apply/in/bucket
    'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', null), // see: Public URLs below
    'visibility' => 'public', // optional: public|private
],
```

### Authentication

[](#authentication)

The Google Client uses a few methods to determine how it should authenticate with the Google API.

1. If you specify a path in the key `key_file` in disk config, that json credentials file will be used.
2. If the `GOOGLE_APPLICATION_CREDENTIALS` env var is set, it will use that.

    ```
    putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');
    ```
3. It will then try load the key file from a 'well known path':

    - windows: %APPDATA%/gcloud/application\_default\_credentials.json
    - others: $HOME/.config/gcloud/application\_default\_credentials.json
4. If running in **Google App Engine**, the built-in service account associated with the application will be used.
5. If running in **Google Compute Engine**, the built-in service account associated with the virtual machine instance will be used.
6. If you want to authenticate directly without using a json file, you can specify an array for `key_file` in disk config with this data:

    ```
    'key_file' => [
        'type' => env('GOOGLE_CLOUD_ACCOUNT_TYPE'),
        'private_key_id' => env('GOOGLE_CLOUD_PRIVATE_KEY_ID'),
        'private_key' => env('GOOGLE_CLOUD_PRIVATE_KEY'),
        'client_email' => env('GOOGLE_CLOUD_CLIENT_EMAIL'),
        'client_id' => env('GOOGLE_CLOUD_CLIENT_ID'),
        'auth_uri' => env('GOOGLE_CLOUD_AUTH_URI'),
        'token_uri' => env('GOOGLE_CLOUD_TOKEN_URI'),
        'auth_provider_x509_cert_url' => env('GOOGLE_CLOUD_AUTH_PROVIDER_CERT_URL'),
        'client_x509_cert_url' => env('GOOGLE_CLOUD_CLIENT_CERT_URL'),
    ],
    ```

### Public URLs

[](#public-urls)

The adapter implements a `getUrl($path)` method which returns a public url to a file.

> **Note:** Method available for Laravel 5.2 and higher. If used on 5.1, it will throw an exception.

```
$disk = Storage::disk('gcs');
$url = $disk->url('folder/my_file.txt');
>>> http://storage.googleapis.com/bucket-name/folder/my_file.txt
```

If you configure a `path_prefix` in your config:

```
$disk = Storage::disk('gcs');
$url = $disk->url('folder/my_file.txt');
>>> http://storage.googleapis.com/bucket-name/path-prefix/folder/my_file.txt
```

If you configure a custom `storage_api_uri` in your config:

```
$disk = Storage::disk('gcs');
$url = $disk->url('folder/my_file.txt');
>>> http://your-custom-domain.com/bucket-name/path-prefix/folder/my_file.txt
```

For a custom domain (storage api uri), you will need to configure a CNAME DNS entry pointing to `storage.googleapis.com`.

Please see  for further instructions.

Usage
-----

[](#usage)

```
$disk = Storage::disk('gcs');

// create a file
$disk->put('avatars/1', $fileContents);

// check if a file exists
$exists = $disk->exists('file.jpg');

// get file modification date
$time = $disk->lastModified('file1.jpg');

// copy a file
$disk->copy('old/file1.jpg', 'new/file1.jpg');

// move a file
$disk->move('old/file1.jpg', 'new/file1.jpg');

// get url to file
$url = $disk->url('folder/my_file.txt');

// Set the visibility of file to public
$disk->setVisibility('folder/my_file.txt', 'public');

// See https://laravel.com/docs/5.3/filesystem for full list of available functionality
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~123 days

Recently: every ~184 days

Total

14

Last Release

1915d ago

Major Versions

1.0.5 → 2.0.02018-02-07

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

1.0.1PHP &gt;=5.5.9

### 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 (19 commits)")[![it-devgroup](https://avatars.githubusercontent.com/u/35729675?v=4)](https://github.com/it-devgroup "it-devgroup (11 commits)")[![nicja](https://avatars.githubusercontent.com/u/2102143?v=4)](https://github.com/nicja "nicja (7 commits)")[![pierlon](https://avatars.githubusercontent.com/u/16200219?v=4)](https://github.com/pierlon "pierlon (2 commits)")[![zoidyzoidzoid](https://avatars.githubusercontent.com/u/2572493?v=4)](https://github.com/zoidyzoidzoid "zoidyzoidzoid (2 commits)")[![regiszanandrea](https://avatars.githubusercontent.com/u/2692748?v=4)](https://github.com/regiszanandrea "regiszanandrea (1 commits)")[![rommni](https://avatars.githubusercontent.com/u/907396?v=4)](https://github.com/rommni "rommni (1 commits)")[![shaunthegeek](https://avatars.githubusercontent.com/u/4971414?v=4)](https://github.com/shaunthegeek "shaunthegeek (1 commits)")[![necenzurat](https://avatars.githubusercontent.com/u/145449?v=4)](https://github.com/necenzurat "necenzurat (1 commits)")[![jbaron-mx](https://avatars.githubusercontent.com/u/11150471?v=4)](https://github.com/jbaron-mx "jbaron-mx (1 commits)")[![jeroen-groenveld](https://avatars.githubusercontent.com/u/26757074?v=4)](https://github.com/jeroen-groenveld "jeroen-groenveld (1 commits)")[![leewillis77](https://avatars.githubusercontent.com/u/1097338?v=4)](https://github.com/leewillis77 "leewillis77 (1 commits)")[![dgoguerra](https://avatars.githubusercontent.com/u/4779130?v=4)](https://github.com/dgoguerra "dgoguerra (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[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)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[spatie/laravel-google-cloud-storage

Google Cloud Storage filesystem driver for Laravel

2408.9M13](/packages/spatie-laravel-google-cloud-storage)[azure-oss/storage-blob-laravel

Azure Storage Blob filesystem driver for Laravel

63582.2k1](/packages/azure-oss-storage-blob-laravel)[zing/laravel-flysystem-obs

Flysystem Adapter for OBS

1211.2k](/packages/zing-laravel-flysystem-obs)[innoge/laravel-rclone

A sleek PHP wrapper around rclone with Laravel-style fluent API syntax

174.1k](/packages/innoge-laravel-rclone)

PHPackages © 2026

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