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 Google Cloud Storage

Flysystem Google Cloud Storage Laravel Package

spatie/flysystem-google-cloud-storage

Google Cloud Storage adapter for Flysystem v1 (PHP 8). A maintained fork adding modern PHP support and merged fixes. Use it to connect Flysystem’s filesystem API to GCS with Google’s client authentication.

View on GitHub
Deep Wiki
Context7

Flysystem v1 adapter for Google Cloud Storage

Frequently asked questions about Flysystem Google Cloud Storage
Can I use this package with Laravel 9 or 10?
No, this package only supports Laravel 8.x due to its dependency on Flysystem v1. Laravel 9+ requires Flysystem v3, so you’d need a v3-compatible adapter like `spatie/flysystem-google-cloud-storage-v3` if available. Check the Laravel upgrade guide for migration paths.
How do I authenticate with Google Cloud Storage?
Use a service account JSON key file. Set it up via `$client->setAuthConfig(__DIR__.'/path/to/service-account.json')` and ensure the account has the `Storage Admin` or `Storage Object Admin` role. Avoid hardcoding credentials in version control or config files.
Is this package actively maintained?
No, the last update was in July 2023. While it works for Laravel 8.x, Flysystem v1 is deprecated, and Google’s PHP SDK may introduce breaking changes. Monitor for security updates or plan a migration to a v3-compatible solution before Laravel 9+ adoption.
How do I configure it in Laravel’s `config/filesystems.php`?
Add a new disk entry under `disks` with `'driver' => 'gcs'`, then define the adapter in the `extend` method. Example: `Storage::extend('gcs', fn() => new GoogleCloudStorageAdapter($client, 'bucket-name'))`. Ensure the bucket name and credentials are correctly passed.
What are the cost implications of using Google Cloud Storage?
GCS pricing includes storage, operations (e.g., PUT/GET), and network egress. Cold storage tiers reduce costs for infrequently accessed files, but latency may increase. Use the [GCS pricing calculator](https://cloud.google.com/products/calculator) to estimate costs based on your expected traffic and file sizes.
Does this package support Laravel’s queue storage or failed jobs?
Yes, you can use GCS as a queue storage driver by configuring it in `config/queue.php` under `connections`. For failed jobs, ensure the `failed` table in your database is synced with GCS if using `queue:retry` with large payloads.
Are there alternatives for Laravel 9+ or Flysystem v3?
Yes, consider `spatie/flysystem-google-cloud-storage-v3` (if available) or community forks like `superbalist/flysystem-google-cloud-storage` for v3 support. For Laravel 9+, also check `league/flysystem-google-cloud-storage` or third-party adapters compatible with Flysystem v3.
How do I handle GCS outages or transient failures?
Implement retries with exponential backoff in your application logic. GCS SDKs support retry configurations, but you may need custom middleware for Laravel’s Storage facade. Test failover to a secondary storage (e.g., S3 or local) during outages.
Can I use this for production workloads with high traffic?
Yes, but benchmark performance under load. GCS has quotas (e.g., 5,000 requests/sec per project), so test concurrency limits. Use regional buckets to minimize latency for global users and monitor costs for operations like list/read heavy workloads.
How do I migrate existing files from S3/local to GCS?
Use Flysystem’s `copy()` or `move()` methods to transfer files between adapters. For large datasets, script a batch process with chunked transfers. Validate data integrity by comparing checksums or file sizes before and after migration.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport