superbalist/flysystem-google-storage
Flysystem adapter for Google Cloud Storage. Adds a Google Storage driver for League\Flysystem so Laravel and PHP apps can store, read, and manage files in GCS using the familiar Flysystem filesystem API, with simple configuration and authentication support.
Strengths:
League/Flysystem stack ensures consistency with other storage backends (S3, local, etc.), reducing context-switching for developers.Weaknesses:
Storage::disk('gcs')->temporaryUrl($path, now()->addHours(1))).FilesystemAdapter compatibility).GOOGLE_APPLICATION_CREDENTIALS (aligns with Laravel’s .env conventions but lacks explicit validation).Vespaime/GcsMock or custom fixtures to test temporary URL generation in PHPUnit.spatie/google-cloud-storage.google/cloud-storage) for critical projects.expires timestamp) in Laravel middleware.env() validation and GCS IAM conditions for fine-grained access control.condition in signed URLs) supported for advanced access control?google/cloud-storage) for signed URLs, or is this adapter sufficient?spatie/google-cloud-storage offer better maintenance or additional features?Storage::disk('gcs')->temporaryUrl($file, now()->addHours(1))).php artisan storage:link, config/filesystems.php).use Superbalist\Flysystem\GoogleStorage\GoogleStorageAdapter;
$adapter = new GoogleStorageAdapter([
'key' => env('GOOGLE_STORAGE_KEY'),
'secret' => env('GOOGLE_STORAGE_SECRET'),
'bucket' => 'my-laravel-bucket',
]);
$url = $adapter->getTemporaryUrl('path/to/file.jpg', now()->addHours(1));
config/filesystems.php to enable signed URLs:
'disks' => [
'gcs' => [
'driver' => 'google',
'key' => env('GOOGLE_STORAGE_KEY'),
'secret' => env('GOOGLE_STORAGE_SECRET'),
'bucket' => env('GOOGLE_STORAGE_BUCKET'),
'region' => env('GOOGLE_STORAGE_REGION', 'us-central1'),
'temporary_url' => [
'enabled' => true,
'default_expiration' => 3600, // 1 hour
],
],
],
GOOGLE_STORAGE_KEY=xxxx
GOOGLE_STORAGE_SECRET=xxxx
GOOGLE_STORAGE_BUCKET=my-laravel-app
Storage facade, Filesystem manager, and new signed URL methods.Illuminate\Filesystem\FilesystemAdapter (Laravel 10.x).spatie/laravel-medialibrary (for signed URL generation in media library).google/cloud-storage SDK directly.Storage::disk('gcs')->temporaryUrl()).laravel-filemanager) to GCS with signed URL sharing.Log::driver('single') withHow can I help you explore Laravel packages today?