- How do I install hprotravel/php-gcp-rest-client in a Laravel app?
- The package is not on Packagist, so add its private Bitbucket repository as a Composer VCS repository and require hprotravel/php-gcp-rest-client from there. Every developer machine, CI runner, and container build needs SSH deploy-key or app-password access to that Bitbucket origin. Pin an explicit tag or commit SHA instead of dev-master so builds remain reproducible.
- Does this package work with Laravel 10 or Laravel 11?
- It is a framework-agnostic PHP library with no Laravel-specific service provider documented, so it can be used inside Laravel 10 or 11 if your PHP and Guzzle/PSR-7 dependency constraints resolve together. Check the Composer lockfile diff in a spike branch before adopting it, because an older Guzzle or psr/http-message pin can conflict during a routine update. There is no published Laravel version support matrix in the provided context.
- How does Google Cloud authentication work with this client?
- The package handles OAuth2 service account authentication with JWT signing and manages access tokens, including caching and refresh behavior. During evaluation, confirm whether it uses google/auth, hand-rolled JWT signing, or pre-supplied bearer tokens, and whether tokens are cached across requests. Also assign ownership for service-account lifecycle and credential rotation, because adopting this package may mean acquiring that responsibility.
- Can I use this package for GCS, Pub/Sub, Secret Manager, or Vertex AI calls?
- It is intended for narrow control-plane REST work such as the GCS JSON API, Pub/Sub publish calls, Secret Manager reads, or Vertex AI predict requests. It is not suitable for bulk data movement, streaming, or high-QPS publishing because Guzzle is synchronous and blocking. Keep those throughput-sensitive workloads on an appropriate SDK or service.
- Is this a replacement for the official google/cloud-* SDK?
- It is a lightweight transport adapter for calling GCP REST endpoints, not a full replacement for the official Google Cloud SDK. The architectural choice is custom HTTP layer versus google/cloud-* packages, and that decision should be recorded as reversible with a named review date. Use it behind an intent-named interface so domain code does not depend on GCP or Guzzle details.
- How should I integrate this GCP REST client into a Laravel architecture?
- Do not call the package directly from controllers, jobs, or domain services. Define intent-named interfaces such as ObjectStorageGateway or SecretReader, then provide a thin implementation backed by this package and bind it in Laravel's container. Domain code should have no knowledge of GCP or Guzzle, which keeps the exit cost low if you later switch to the official SDK.
- Does it handle retries, timeouts, pagination, and GCP error responses?
- A simple adapter like this typically does not include cross-cutting concerns such as jittered retry on 429 or 503, pagination helpers, long-running-operation polling, structured GCP error-envelope parsing, or explicit timeouts. Treat each missing capability as work your consuming team must implement or configure. Sequence that work deliberately rather than discovering the gaps during incident response.
- How do I test Laravel code that uses this GCP REST client?
- Wrap the client behind an interface and fake that interface in unit and feature tests so normal tests do not call Google Cloud. Add a scheduled contract test against a live GCP sandbox endpoint to catch silent API drift, deprecations, and field renames. Assign a named owner for that scheduled test so failures are acted on.
- What production risks should I consider before adopting this package?
- The main risk is concentration: this is a private VCS-consumed package with no external community, maintainer bench, or public issue history, so register it as a bus-factor risk with a named owner. The dominant failure mode is silent GCP REST API drift that surfaces as production 400 errors rather than security advisories. Loss of Bitbucket repository access can also break builds and hotfixes, which is worse than a runtime-only outage, so secure and document credentials for every pipeline.
- What alternatives should I compare with hprotravel/php-gcp-rest-client?
- Compare it with the official google/cloud-* SDK and with using google/auth plus Guzzle directly in a small custom adapter. Evaluate endpoint coverage, authentication ownership, token caching, lockfile safety, and whether you need gRPC, streaming, or higher throughput. The custom REST client is reasonable only for a handful of control-plane endpoints hidden behind a clean interface.