- 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.