Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Cloud Common Protos

Cloud Common Protos Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Google Cloud PHP Common Protos provides the shared Protocol Buffers (protobuf) message types used across multiple Google Cloud APIs, generated for PHP as part of the broader Google Cloud PHP ecosystem. The underlying .proto definitions live in the googleapis repository, while this package delivers the ready-to-use PHP classes via Composer.

Use it as a stable, Apache-2.0 licensed dependency when working with Google Cloud client libraries or integrating protobuf-based data models in your PHP applications.

  • Shared protobuf types used by multiple Google Cloud APIs
  • Generated, Composer-installable PHP classes (google/cloud-common-protos)
  • Backwards-compatible stability guarantees for public types
  • Source .proto definitions maintained in the googleapis repo
  • Permissive Apache 2.0 license suitable for production use
Frequently asked questions about Cloud Common Protos
How do I install google/cloud-common-protos in a Laravel project?
Run `composer require google/cloud-common-protos` in your Laravel project directory. Ensure your PHP environment has the `google/protobuf` extension (v5+) installed, which may require Docker or server-level configuration. Laravel Sail or Dockerized setups simplify this dependency.
Does this package work with Laravel 10 and PHP 8.2?
Yes, this package supports modern Laravel (tested with PHP 8.1+). Check the [Google Cloud PHP requirements](https://github.com/googleapis/google-cloud-php#requirements) for exact version compatibility. Laravel 10 and PHP 8.2 are fully supported if the extension dependencies are met.
Can I use these protobuf classes as Eloquent models in Laravel?
No, these protobuf classes are not ORM-compatible. Use them as immutable DTOs or serialize them to JSON for storage (e.g., `json_encode($protobufObject)`). For database storage, consider binary blobs or JSON fields in your Laravel models.
What if my hosting provider doesn’t support the google/protobuf PHP extension?
Shared hosting rarely supports PHP extensions like `google/protobuf`. Use Docker (e.g., `FROM php:8.2-cli` with `docker-php-ext-install protobuf`) or Laravel Sail for local development. For production, consider cloud-based PHP environments like Heroku or AWS ECS with custom Docker images.
How do I handle protobuf schema evolution (e.g., deprecated fields) in Laravel?
This package guarantees backward compatibility for public types. For deprecated fields, use Google’s recommended strategies (e.g., ignoring them or implementing custom migration logic). Monitor updates in the [googleapis/googleapis](https://github.com/googleapis/googleapis) repo for breaking changes.
Is this package suitable for gRPC services in Laravel?
Yes, but it requires the `grpc/grpc` PHP extension. Use protobuf classes for high-performance gRPC endpoints in Laravel, paired with middleware to decode protobuf payloads. Start with REST APIs if gRPC is new to your team to reduce complexity.
What’s the difference between this package and google/cloud-logging or other Google Cloud SDKs?
This package provides **shared protobuf message types** (e.g., `AuditLog`, `Status`) used by multiple Google Cloud APIs and SDKs. SDKs like `google/cloud-logging` depend on this package internally. Use it directly if you need low-level protobuf access or are building custom GCP integrations.
How do I validate protobuf data in Laravel instead of using Laravel’s built-in validation?
Protobuf classes include built-in validation for GCP-specific fields (e.g., `PermissionType`). Use the protobuf’s `serializeToString()` and `parseFromString()` methods to validate data before processing. For Laravel forms, validate inputs first, then deserialize into protobuf objects.
Are there alternatives to this package for protobuf support in Laravel?
For Google Cloud APIs, this is the official package. For general protobuf in PHP, consider `php-protobuf` (pure PHP, no extension) or `grpc/grpc` (for gRPC). However, these lack Google Cloud’s canonical schemas. If you’re not using GCP, evaluate whether protobuf is necessary for your use case.
How do I debug protobuf issues in Laravel, especially with Xdebug?
Enable the `google/protobuf` extension in your Docker/Laravel Sail setup for local debugging. Use `Xdebug` with `php.ini` settings like `extension=protobuf.so` and ensure your IDE (e.g., PHPStorm) is configured to load extensions. Test protobuf serialization/deserialization in isolation before integrating with Laravel.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport