- What is google/cloud and is it a Laravel package?
- google/cloud is the official PHP client library for Google Cloud, not a Laravel-specific package. It is framework-agnostic and has no service provider, facade, or config publishing, so Laravel integration is something you wire up yourself. It provides service-specific clients for Cloud Storage, Pub/Sub, BigQuery, Firestore, and other GCP services through a consistent API.
- How do I install google/cloud with Composer in Laravel?
- Run composer require google/cloud from your Laravel project root. The meta-package pulls in the individual google/cloud-* clients plus shared authentication and transport dependencies. Commit your composer.lock and resolve any Guzzle, protobuf, or gRPC conflicts at the lockfile level before deploying.
- Does google/cloud support Laravel 10, 11, and 12?
- google/cloud is Laravel-version-agnostic; it requires PHP 8.1 or newer and does not depend on a specific Laravel release. That means it works alongside Laravel 10, 11, and 12 as long as your PHP runtime and other Composer dependencies are compatible. You are responsible for binding clients into Laravel's container yourself.
- Should I install google/cloud or only google/cloud-storage?
- Use google/cloud only when you need several Google Cloud services or want guaranteed compatible pinning across components. For a typical Laravel app that needs one to three services, install the granular package instead, such as google/cloud-storage or google/cloud-bigquery. The meta-package pulls in a large surface area and many transitive dependencies.
- How does google/cloud authenticate in a Laravel app?
- It uses Application Default Credentials by default, which can come from service-account JSON, workload identity federation, or instance metadata. In production, prefer workload identity or metadata-based credentials and avoid committing service-account JSON files. Do not put credential paths or JSON into config:cache dumps or container images.
- Do I need the gRPC PHP extension for google/cloud?
- Some Google Cloud clients default to gRPC and require the grpc PHP extension, while others can use REST. If your Laravel Vapor, Forge, or container runtime cannot install grpc, configure the client to use REST explicitly instead of relying on silent fallback. Verify extension availability in every target environment.
- How do I test google/cloud code locally without a GCP project?
- Several Google Cloud services provide emulators, and you can point google/cloud clients at them through environment-specific configuration. For services without emulators, mock at your own domain interfaces rather than mocking vendor Google Cloud client classes directly. A sandbox GCP project is also useful for integration tests that need real service behavior.
- What is the best way to use Google Cloud Storage as a Laravel disk?
- Install spatie/flysystem-google-cloud-storage, which adapts Google Cloud Storage to Laravel's Flysystem-based Storage facade. Use google/cloud-storage or google/cloud as the underlying client and configure the disk in config/filesystems.php. Keep application code on the Storage facade so you can swap drivers later.
- How do I use Pub/Sub or BigQuery with google/cloud in Laravel?
- Pub/Sub and BigQuery have no Laravel-native abstraction, so wrap them behind your own interfaces such as EventBus and AnalyticsGateway. Bind those wrappers as lazy singletons in a small service provider and keep Google Cloud client imports out of controllers and models. This preserves testability and makes future provider changes bounded.
- Is google/cloud production-ready and how do I avoid dependency or credential problems?
- Yes, it is the official Google client library and supports retries, pagination, lazy-loaded clients, and long-running operations. Production risk comes from dependency weight, gRPC availability, frequent component releases, and credential mishandling. Pin versions in composer.lock, resolve conflicts before deployment, and prefer workload identity federation over committed service-account keys. The meta-package's low Packagist dependent count reflects its umbrella nature rather than abandonment.