Weave 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

Protobuf Plugin Laravel Package

protobuf-php/protobuf-plugin

A protoc plugin that generates PHP classes from .proto definitions for the protobuf-php runtime, enabling typed Protocol Buffer message serialization and deserialization in PHP projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is not a Laravel package in the conventional sense: it ships no service provider, no facade, no config publish, and no runtime code path. It is a protoc plugin — a build-time binary that protoc invokes to emit PHP classes from .proto definitions. Its architectural home is the CI/build toolchain, not the application container.
  • It is tightly coupled to the sibling runtime protobuf-php/protobuf (the pure-PHP message runtime). Adopting the plugin without that runtime (or vice versa) is not viable. This matters because the runtime, not the plugin, is what your application actually depends on at request time.
  • For a Laravel codebase the realistic leverage is schema-first contracts: shared .proto files between Laravel services and non-PHP services (Go, Java, Python), gRPC clients/servers, or compact event payloads on a queue. It is a poor fit for anything that only talks JSON to itself.

Integration feasibility

  • Mechanically simple: add the plugin as a require-dev Composer dependency, install a pinned protoc in the build image, and invoke protoc --plugin=protoc-gen-php=... --php_out=.... Generated classes are plain PHP and drop into PSR-4 autoloading (e.g. app/Generated/ or a first-party packages/contracts directory).
  • No Laravel lifecycle integration is needed or offered. If you want ergonomics, you wrap invocation in an Artisan command yourself; that wrapper is your code to own.
  • The real friction is toolchain, not framework: protoc must exist in every environment that regenerates code, and the plugin's expected protoc version must be pinned alongside it.

Technical risk

  • High. Last release 2017-01-12, 57 stars, zero dependents. This is effectively an abandoned artifact. There is no evidence of PHP 8.x validation, and generated code from that era commonly trips deprecations (dynamic properties, nullable defaults, each()-era idioms) or hard-fails on modern runtimes.
  • The upstream problem is largely solved elsewhere: official protoc has shipped a built-in --php_out generator since 3.x, paired with google/protobuf. Choosing this plugin means deliberately selecting the older, unmaintained path.
  • Supply-chain exposure: an unmaintained dev dependency that executes during builds is a standing risk with no security-response channel.
  • Version-pinning fragility: a protoc upgrade in the base image can silently change generated output or break the plugin handshake.

Key questions

  1. Do we actually need protobuf, or is this schema-first ambition better served by JSON Schema / OpenAPI for our current traffic patterns?
  2. If protobuf is required, why this plugin rather than protoc --php_out with google/protobuf?
  3. Which protoc version will we pin, and who owns that pin?
  4. Do we need gRPC (which pulls in ext-grpc and a different runtime story) or only wire-format serialization?
  5. Do we need proto3 optional, Any, and well-known types — areas where old generators are weakest?
  6. Who owns the .proto contracts, and what is the versioning/compatibility policy across services?
  7. Are we prepared to fork and maintain this plugin, or is this a spike that ends in a documented rejection?

Integration Approach

Stack fit

  • Laravel 9–11 / PHP 8.1+ is an uncomfortable fit for a 2017 generator plus its 2017 runtime. Treat compatibility as unproven until a spike generates and round-trips a representative message on the target PHP version.
  • Cleanest placement: contracts live in a dedicated first-party package (packages/contracts or a private Composer repo) consumed by the Laravel app. This keeps generated code out of app/ and makes it shareable with other PHP services.
  • Build-time only. Nothing about this should appear in config/, the service container, or bootstrap/providers.php.

Migration path

  • Default recommendation: start on google/protobuf + protoc --php_out and skip this plugin entirely. If you inherit a codebase already on protobuf-php/protobuf, this plugin is the consistent choice and migration should be sequenced separately.
  • If migrating off: run both generators against the same .proto set in a branch, diff the public surface (class names, namespaces, getters/setters, enum handling), and convert call sites behind an internal serialization adapter so application code does not bind to generated classes directly.
  • Introduce an anti-corruption layer first (MessageSerializer interface with a protobuf implementation), then swap the underlying runtime behind it. That makes the generator choice reversible.

Compatibility

  • Verify: Composer constraints against PHP 8.x, generated-code syntax against your linter/static analysis (PHPStan/Larastan will surface deprecated constructs quickly), PSR-4 namespace mapping, and coexistence with google/protobuf — installing both runtimes in one app is a known source of class and extension conflicts. Do not allow both.
  • Pin protoc, the plugin, and the runtime as a matched triple in composer.json and the Dockerfile. Record the triple in the repo.

Sequencing

  1. Spike (1 week): generate a representative message with both this plugin and protoc --php_out; run round-trip and PHP 8.2 smoke tests; write a one-page recommendation.
  2. Contract design: agree .proto ownership, naming, versioning, and breaking-change policy before any codegen lands.
  3. Build pipeline: add protoc + pinned plugin to the CI image; add a make proto / Artisan wrapper; make CI fail when generated output drifts from committed output.
  4. Runtime layer: wire the serialization adapter; add integration tests covering schema evolution (added fields, unknown fields, defaults).
  5. Rollout: one low-risk boundary first — typically an outbound event payload or an internal service call — not the public API.
  6. Decommission check: if the spike favors the official generator, close this out with a documented decision rather than letting it linger as an unowned dependency.

Operational Impact

Maintenance

  • Effectively zero upstream maintenance. Any bug fix, PHP version bump, or protoc compatibility patch is yours. Budget either a fork with an owner or a planned exit. With zero dependents, there is no community patch flow to free-ride on.
  • Generated code volume becomes a review burden; committing generated output aids auditability but inflates diffs. Pick one policy (commit + CI drift check, or artifact-only) and enforce it.

Support

  • No vendor, no active maintainer, minimal community surface (57 stars, no dependents). Internal expertise is the only support channel. Expect Stack Overflow to be unhelpful for anything version-specific.
  • Ramp-up cost is real but bounded: a PHP team needs roughly one to two sprints to become productive with .proto authoring, protoc invocation, and wire-format debugging. gRPC adds meaningfully more than plain serialization.

Scaling

  • Codegen itself scales trivially; generation cost is a build-time constant.
  • Runtime characteristics are the concern: protobuf typically beats JSON on payload size and decode cost, which helps queue throughput and inter-service bandwidth. Under Laravel Octane, ensure generated message classes are treated as immutable value objects and not cached per-request in ways that leak state across workers.
  • The organizational scaling risk dominates: every additional service multiplies the number of pinned protoc/plugin/runtime triples you must keep aligned.

Failure modes

  • Silent schema drift: services regenerate from different .proto revisions and deserialize partially, producing null/zero defaults instead of errors. Mitigate with a shared contracts repo and CI drift checks.
  • Plugin/protoc handshake failure: the build breaks or, worse, emits subtly different code after a base-image bump. Pin aggressively.
  • Runtime/extension conflict: protobuf-php/protobuf colliding with google/protobuf or ext-protobuf yields confusing class-resolution errors at boot.
  • PHP 8 fatals in generated code: deprecations become exceptions; surfaces late, often in production paths not covered by tests.
  • Missing well-known types: Timestamp, Duration, Any handling is a common gap in older generators; teams hand-roll conversions and drift.
  • Bus-factor: a single unmaintained dependency in the build path with no named internal owner is a recurring incident source.

Ramp-up and recommendation

  • Treat this as a conditional reject. The plugin is only defensible if you already run protobuf-php/protobuf in production; greenfield work should use protoc --php_out with google/protobuf. Fund the one-week spike, require a written decision with the pinned version triple, and gate adoption on the PHP 8.x round-trip test passing. Absent that evidence, the expected value of adopting a 2017-era, zero-dependent codegen plugin in a modern Laravel stack is negative.
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package