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

Product Decisions This Supports

  • Cloud Storage Strategy: Enables seamless integration with Google Cloud Storage (GCS) for Laravel applications, aligning with a multi-cloud or GCP-first storage strategy. Reduces vendor lock-in by providing a standardized Flysystem interface for GCS.
  • Cost Optimization: Supports object lifecycle management (e.g., tiered storage, archival) via GCS, reducing costs for long-term storage compared to local/S3 alternatives.
  • Laravel Ecosystem Compatibility: Bridges legacy Laravel (v8.x) apps using Flysystem v1 with GCS, avoiding forced upgrades to Flysystem v2. Critical for maintaining backward compatibility in monolithic systems.
  • Media/Asset Management: Powers features like:
    • User uploads (profiles, avatars, documents).
    • CDN-backed static assets (images, videos) with GCS’s global caching.
    • Backup solutions (e.g., database dumps, logs) leveraging GCS’s durability (11 9’s).
  • Roadmap Prioritization:
    • Build vs. Buy: Avoids reinventing GCS integration (saves ~2–4 weeks of dev time).
    • Phased Migration: Enables incremental adoption of GCS for specific use cases (e.g., media) before full cloud migration.
  • Compliance/Regionality: Meets GDPR/region-specific storage requirements by configuring GCS buckets in EU/US regions.

When to Consider This Package

Adopt This Package If:

  • Your Laravel app (v8.x) uses Flysystem v1 and needs GCS integration.
  • You’re evaluating GCP for primary storage (vs. AWS S3, Azure Blob, or local storage).
  • Your team lacks expertise in custom GCS SDK integrations but needs production-ready reliability.
  • You require Flysystem’s abstraction layer for interchangeable storage backends (e.g., switch from S3 to GCS later).
  • Your use case aligns with GCS strengths:
    • High durability for backups/logs.
    • Global CDN for static assets.
    • Cost-effective cold storage (Nearline/Coldline).

Look Elsewhere If:

  • You’re on Laravel 9+ or Flysystem v2+: Use spatie/flysystem-google-cloud-storage-v2 or the official google/cloud-storage SDK.
  • You need advanced GCS features unsupported here (e.g., signed URLs, HSM encryption, or V2 API features like dual-region storage).
  • Your app is PHP 7.x-only: This package requires PHP 8.
  • You’re locked into AWS/Azure and lack multi-cloud flexibility needs.
  • You prioritize active maintenance: This is a low-activity fork (last release 2023-07-20); monitor for updates or consider the original package for critical projects.

How to Pitch It (Stakeholders)

For Executives/Business Leaders:

"This package lets us leverage Google Cloud Storage for our Laravel app’s file storage—without rewriting our existing codebase. Key benefits:

  • Cost savings: GCS’s tiered storage (e.g., $0.004/GB/month for Coldline) could cut storage costs by 30–50% vs. S3 for archival data.
  • Scalability: Handles unlimited growth for user uploads/media without local infrastructure.
  • Compliance: Store data in region-specific buckets (e.g., EU) to meet GDPR/local laws.
  • Risk reduction: Avoids vendor lock-in by using Flysystem’s standard interface—we can switch providers later if needed. Implementation is low-risk: It’s a drop-in replacement for existing storage logic, with no downtime. The team estimates <2 weeks to integrate and test. ROI comes from operational savings and future flexibility."

For Engineering/Tech Leads:

"This is a mature, battle-tested Flysystem adapter for GCS, tailored for Laravel 8.x. Why use it?

  • Proven reliability: Built on the official Google Cloud Storage PHP SDK, with Spatie’s reputation for quality.
  • Performance: Optimized for high-throughput operations (e.g., batch uploads, CDN caching).
  • Security: Inherits GCS’s IAM, encryption (AES-256), and VPC Service Controls.
  • Dev velocity: No custom SDK work—just configure credentials and bucket names. Example setup:
    use Spatie\FlysystemGoogleCloudStorage\GoogleCloudStorageAdapter;
    $adapter = new GoogleCloudStorageAdapter('my-bucket', [
        'keyFilePath' => '/path/to/service-account.json',
        'projectId' => 'my-gcp-project',
    ]);
    $filesystem = new \League\Flysystem\Filesystem($adapter);
    
  • Monitoring: Integrates with GCP’s native logging/metrics (e.g., Cloud Logging, Storage Analytics). Caveats: PHP 8 only; not for Flysystem v2. If we’re on Laravel 9+, we should evaluate the v2 adapter instead. For now, this is a safe, low-effort way to adopt GCS."*

Call to Action:

  • For Execs: "Approve a POC to migrate a non-critical storage use case (e.g., user avatars) to GCS using this package."
  • For Engineers: "Benchmark this against our current storage solution and propose a migration plan for [X] feature."
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