yaza/laravel-google-drive-storage
Laravel filesystem driver that lets you use Google Drive as a native storage disk. Configure a service account, then upload, download, list, and stream files through Laravel's Storage facade like any other disk. Supports folders, metadata, and seamless integration into existing Laravel apps.
Architecture fit. The package targets the one seam in Laravel where a third-party backend is cheapest to adopt: the Storage facade / Illuminate\Filesystem\FilesystemManager. Expect a Flysystem adapter registered as a custom disk driver (filesystems.disks.drive.driver = google-drive) plus a service provider and a credentials block (service account JSON or OAuth client/refresh token). Architecturally this is the right shape — application code keeps talking Storage::disk('drive')->put(...) and stays unaware of Google. The real architectural question is not Laravel fit but whether Google Drive's document-store semantics (ID-addressed items, duplicate names permitted in a folder, no atomic rename, no true directories) map cleanly onto Flysystem's path-based contract. Every rough edge in this package will come from that impedance mismatch, not from Laravel.
Integration feasibility. Low-friction on paper: composer require yaza/laravel-google-drive-storage, publish config, add a disk, done. Credential provisioning is the actual work — a GCP project, Drive API enabled, service account created, and the service account granted access to a specific folder or Shared Drive. That is IAM work, not code work, and it is where most POCs stall. Feasibility is high for read/write/list on moderately sized files; unproven for anything exotic.
Technical risk. Concentrated in four places:
league/flysystem can strand us.Key questions to put to the maintainer (or answer in a spike):
league/flysystem major version(s), and which Laravel/PHP versions, are supported and CI-tested?403 rateLimitExceeded / 404 / 401 errors mapped into Flysystem exceptions?Stack fit. Good for a Laravel app that already treats object storage as an implementation detail — background jobs writing exports, user-uploaded documents, archival of generated reports, admin-triggered backups. Poor fit for anything with hard latency budgets, high request throughput, or CDN-fronted static assets.
Compatibility. Pin the package and audit composer why-not against our existing league/flysystem* and guzzlehttp/guzzle constraints before committing. A version conflict here surfaces as a failed install late in the sprint, so resolve it in the first hour of the spike.
Migration path. Do not swap the default disk. Sequence it:
put, get, exists, delete, files, allFiles, url, and a ~100 MB file. Time the listing calls.drive alongside the existing default. Feature-flag by disk name in config/env. No production reads from Drive yet.Sequencing constraints. Auth provisioning must precede all code work — it is the critical path, not the composer install. And the "swap out later" interface should land before the first production write, not after; retrofitting it post-migration costs an order of magnitude more.
Maintenance. We should assume we are co-owners, not customers. Budget: pin the version, subscribe to releases, and reserve capacity to vendor or fork if upstream goes quiet. The MIT license permits it; the absence of dependents means we should plan for it rather than hope. Track Google's Drive API deprecations independently of the package — the maintainer may be slower than the platform.
Support. No SLA, no vendor to escalate to. We need an internal runbook covering token rotation, service-account re-grant, quota diagnosis, and disk fallback. Also flag the OAuth consent-screen verification requirement if user-facing scopes are ever used — that is a multi-week Google review, not a config change.
Scaling. Drive enforces per-user and per-project rate limits (quota units per 100 seconds) and is not built for high request volume. Three practical ceilings:
rateLimitExceeded first. Needs retry-with-backoff and, realistically, write batching or throttling.Verdict from a capacity standpoint: suitable for low-to-moderate volume, asymmetric workloads (many writes, few listing reads), and internal/back-office files. Not suitable as a primary store for user-facing media or high-QPS traffic.
Failure modes to design for. Expired or revoked refresh token; service account removed from the shared folder (silent 404s that look like data loss); quota exhaustion under burst; Google 5xx and transient network faults; duplicate filenames making path lookup nondeterministic; partial uploads leaving orphaned files; delete semantics differing from expectations (trash vs. hard delete) affecting retention and compliance posture; and permission inheritance surprising users who can see a file in Drive but not in the app. Each needs an explicit detection and fallback, with the disk-level fallback the most important.
Ramp-up. For Laravel developers, hours — the Storage API is familiar and the config is conventional. For the platform/ops side, days — GCP project setup, service-account scoping, Shared Drive permissions, and quota monitoring are the real learning curve. Plan one engineer-owner with IAM literacy, not just a Laravel generalist.
Bottom line. Technically sound, architecturally well-placed, and cheap to trial — but the adoption signals (0 dependents, solo maintainer, thin description) mean it should enter as an experiment behind an abstraction, not as a committed dependency. Fund the spike and the port interface; gate production cutover on the answers to the questions above.
How can I help you explore Laravel packages today?