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.
Pros:
Storage facade (via league/flysystem-*).Cons:
google/cloud-storage SDK (v1.27+ recommended for stability).league/flysystem (v1.x)google/cloud-storage (PHP SDK for GCS)spatie/flysystem-* utilities (if using Spatie’s other packages).$client = new Google_Client();
$client->setAuthConfig(__DIR__.'/path/to/service-account.json');
$storage = new GoogleCloudStorageAdapter($client, 'my-bucket');
Storage::extend('gcs', function () use ($storage) {
return new FilesystemAdapter($storage);
});
storage.admin).Storage::disk('gcs')->put() edge cases).spatie/flysystem-google-cloud-storage-v3)?Storage facade (e.g., Storage::disk('gcs')->put()).local, s3, or ftp with gcs in config/filesystems.php.queue:retry).league/flysystem directly with the adapter for custom apps.filesystems.php to point to GCS.Storage::url(), ensure GCS URLs are publicly accessible (or use signed URLs).gsutil CLI exports).put, get, delete, copy, visibility, metadata, stream downloads.Visibility::PRIVATE may not map 1:1 to GCS ACLs (verify).GoogleCloudStorageAdapter::temporaryUrl() for secure downloads.Storage::temporaryUrl().response()->file(Storage::disk('gcs')->path('file.jpg')) requires streaming.composer require spatie/flysystem-google-cloud-storage.Storage::disk('s3') with Storage::disk('gcs') in critical paths.google/cloud-storage SDK updates.Google_Auth_Exception: Invalid/expired credentials.Google_Service_Exception: Bucket not found or permission denied.RuntimeException: File not found (check case sensitivity in GCS).storage.googleapis.com/logs).gsutil CLI for manual inspection: gsutil ls gs://bucket-name/.How can I help you explore Laravel packages today?