google/gax
Google API Core for PHP (gax-php) provides shared infrastructure for Google API clients, especially generated libraries using gRPC. Includes helpers for retries, pagination/page streaming, long-running operations, and Google API conventions. Requires PHP 8.1+.
InsecureCredentialsWrapper and emulator support (critical for CI/CD).ApiException::getErrorDetails()) for debugging distributed systems.protobuf definitions) with idiomatic PHP interfaces.googleapis/client-core or guzzlehttp/guzzle."Leverage Google’s Production-Grade gRPC Infrastructure in PHP Without Rebuilding It"
gax-php is Google’s official, GA-grade library for gRPC clients in PHP, used internally across Google Cloud services. It:
"Stop Reinventing the Wheel for gRPC Clients—Use Google’s Battle-Tested Core"
googleapis/googleapis repo), adding retry logic, streaming, and auth automatically.GapicClientTrait::prependMiddleware().InsecureCredentialsWrapper—no cloud credentials needed.TransportCallMiddleware).use Google\ApiCore\ApiException;
use Google\Cloud\Storage\V1\StorageClient;
$client = new StorageClient([
'credentials' => $serviceAccountCredentials,
'emulator' => true, // Local testing
]);
try {
$results = $client->listBuckets();
foreach ($results as $bucket) {
echo $bucket->name() . "\n";
}
} catch (ApiException $e) {
// Rich error details: $e->getErrorDetails()
error_log($e->getMessage());
}
How can I help you explore Laravel packages today?