google/cloud-common-protos
Generated PHP Protocol Buffer classes shared across Google Cloud APIs (part of google-cloud-php). Install via Composer as google/cloud-common-protos to use stable, Apache-2.0 licensed common proto message types in your apps.
AuditLog, Status, HttpRequest). It aligns perfectly with Laravel applications requiring structured data exchange with Google Cloud APIs, especially for:
Google\Rpc\Status format.google/cloud-logging). Adopting this package indirectly via SDKs (e.g., composer require google/cloud-logging) is the lowest-risk path for most Laravel applications.composer require google/cloud-common-protos. However, direct adoption is rarely needed—most use cases will leverage it through SDKs.google/protobuf extension (v5+), which may introduce:
grpc/grpc).json_encode($protobuf->serializeToJsonString())).ReservationResourceUsage). Laravel applications must handle:
@deprecated may trigger runtime warnings.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PHP Extension Dependency | High | Test extension installation in CI/CD early; document requirements for devops teams. |
| Immutability Conflicts | Medium | Use DTO mappers (e.g., spatie/laravel-data) to convert between protobuf and Eloquent. |
| Version Conflicts | Medium | Pin google/protobuf to a specific version (e.g., ^5.0) in composer.json. |
| Schema Evolution | Low | Monitor Google Cloud PHP SDK releases for breaking changes; use feature flags for deprecated fields. |
| Testing Complexity | Medium | Implement custom serializers for protobuf objects in API responses. |
| gRPC/Protobuf Expertise | High | Assign a team member to protobuf best practices; provide training if lacking. |
google/protobuf extension? If not, is there a fallback plan (e.g., pure-PHP protobuf parsers like prooph/pds)?ReservationResourceUsage)? Will they be gradually phased out or replaced?google/cloud-logging), which bundle google/cloud-common-protos as a dependency.grpc/grpc for client/server communication.protoc to generate PHP classes from .proto files.| Integration Level | Steps | Tools/Dependencies |
|---|---|---|
| Indirect (SDK-Driven) | 1. Add Google Cloud SDK (e.g., composer require google/cloud-logging).2. Use SDK clients (e.g., LoggingClient)—this package is auto-included.3. Configure Laravel service provider to bind SDK clients. |
google/cloud-*, Laravel Service Container |
| Direct (Protobuf Access) | 1. Add google/cloud-common-protos to composer.json.2. Install google/protobuf extension.3. Use generated classes (e.g., Google\Logging\Type\LogEntry) in business logic.4. Implement DTO mappers for Laravel. |
google/cloud-common-protos, google/protobuf |
| gRPC Services | 1. Define .proto schemas.2. Generate PHP classes with protoc.3. Add google/cloud-common-protos for shared types.4. Integrate gRPC client/server with Laravel. |
grpc/grpc, protoc, google/cloud-common-protos |
google/protobuf v5 dependency).google/cloud-logging:^1.0). Avoid mixing versions (e.g., SDK v1.0 with google/cloud-common-protos:^0.8).google/protobuf extension in development/production (Dockerfile example):
RUN pecl install protobuf && docker-php-ext-enable protobuf
google/cloud-* packages first.google/cloud-common-protos and pin google/protobuf version.$this->app->singleton(LoggingClient::class, fn() => new LoggingClient());
How can I help you explore Laravel packages today?