google/cloud-storage
Google Cloud Storage for PHP is an idiomatic client for uploading, downloading, and managing objects and buckets, with ACL support, a gs:// stream wrapper, and simple Composer installation.
StorageClient can be bound in Laravel's service container or resolved through a facade. From a TPM standpoint this is a low-friction fit: no framework patching, no custom bootstrapping.### Miscellaneous Chores), so the notes themselves cannot be used to infer compatibility. The TPM action is to diff the 1.x → 2.x changelog and upgrade guide before relying on any compatibility claim in this document.storage/app or sit behind spatie/laravel-medialibrary for cloud-native workflows.gs:// stream wrapper enables transparent file operations (file_get_contents('gs://bucket/file.txt')), removing boilerplate from controllers and services.Filesystem contract via a custom adapter, giving a unified idiom across local and cloud disks.can:download-file).OBJECT_FINALIZE) can dispatch Laravel jobs for post-processing (image optimisation, metadata indexing).env()-driven credential paths, narrow IAM roles, no keys in VCS.composer.json constraints — this is the most likely place a major bump has moved the floor.UPGRADING.md?location constraints)?RetryOptions backoff cover the failure windows we care about?storage/app with GCS for user uploads, static assets via the gs:// wrapper, and queue-driven file processing.spatie/laravel-medialibrary as the upload/metadata layer, Livewire for dynamic uploads served via signed URLs, league/flysystem as the portability seam.OBJECT_FINALIZE → HandleVideoTranscodeJob).Phase 0 — Version Reconciliation (new, blocking)
composer.json and changelog; compare PHP and Laravel constraints against the app's runtime.Phase 1 — Pilot with Non-Critical Data
gs://bucket/public/assets.$storage = new \Google\Cloud\Storage\StorageClient();
$storage->registerStreamWrapper();
// file_get_contents('gs://bucket/public/assets/app.css')
Phase 2 — Core Functionality
Filesystem contract, registering an gcs disk in config/filesystems.php with bucket and project ID from env().Phase 3 — Advanced Features
local → gcs disk), Intervention Image (write processed output to gcs), Laravel Debugbar (inspect GCS API calls).users, posts, etc. to store gs://bucket/path rather than local paths. Plan a backfill script and a dual-read window..env, never in VCS.Storage::disk('local')->put() → Storage::disk('gcs')->put(); update Blade URL generation.$bucket->upload(fopen('large-video.mp4', 'r'), ['resumable' => true]);
$url = $object->signedUrl(new \DateTime('+15 minutes'));
^2.5) rather than an exact tag, so chore releases flow in while majors stay gated behind an explicit upgrade ticket.StorageClient as a singleton — re-instantiating per request multiplies handshake latency across PHP-FPM workers.RetryOptions, plus a documented read-only degradation path.gs:// writes can fail without a loud exception in some paths. Assert on write results rather than assuming success.How can I help you explore Laravel packages today?