roadrunner/api-dto
roadrunner/api-dto provides typed Data Transfer Objects for Laravel APIs. Define DTOs to convert request arrays into structured objects, validate and cast attributes, and handle nested data, keeping controllers lean and API payloads consistent and type-safe. Designed to keep API code organized.
Architecture fit
roadrunner/api-dto is not an application-layer library. It is the PHP-side representation of the RoadRunner (Go) server's protobuf API — the wire contract for the RPC channel between a PHP worker and the rr binary. It belongs to the infrastructure tier, not the domain tier.spiral/roadrunner-http, -jobs, -kv, -metrics, -websockets directly). It has essentially zero relevance for FPM/nginx deployments or Swoole-based Octane.roadrunner/api-dto ahead of this release; v2.1.0 makes that name official. The substantive technical evaluation is therefore unchanged — what changes is the dependency-management plan around it.Integration feasibility
require and every lockfile that names the old package. Treat it as a major.spiral/roadrunner-* packages must themselves have released versions requiring the new name before the DTO rename can land transitively. Until they do, an explicit require of roadrunner/api-dto risks installing both names side by side.ext-protobuf) remains an out-of-scope escape hatch, not a normal workflow.Technical risk
composer why reference against the old name goes stale in the same change.RoadRunner\DTO\*, any direct consumer breaks with class-not-found — another argument for forbidding direct application usage.ext-protobuf is required or optional. If optional, the pure-PHP fallback works but is materially slower — a silent performance cliff rather than a hard failure.Key questions
roadrunner driver, or via any spiral/roadrunner-* package directly? If no, this evaluation terminates: do not adopt.5246175, not from the repo URL), and is it being marked abandoned / does it ship a replace pointing at the new name?spiral/roadrunner-http, -worker, -jobs, -kv, -metrics, -websockets require roadrunner/api-dto? Can we reach a tree where only the new name resolves?rr binary version (Docker image tag or downloaded artifact) is our baseline, and which api-dto tag corresponds to it?ext-protobuf present in our base image and in every environment including CI and local dev? If not, are we accepting the fallback codec's throughput?Stack fit
roadrunner-jobs (queue), roadrunner-metrics (Prometheus), roadrunner-kv, or roadrunner-websockets (Centrifugo).Migration path
spiral/roadrunner-* set to versions that require roadrunner/api-dto, let Composer resolve the new name, and never type it. This keeps the DTO governed as plumbing.composer remove the old name, composer require roadrunner/api-dto:^2.1 in a single commit, then verify with composer why roadrunner/api-dto that exactly one provider exists.conflict entry against the old package name in composer.json so a stray transitive require hard-fails at resolve time instead of silently installing a duplicate PSR-4 root.--server=roadrunner → Composer resolves spiral/roadrunner-* → those require the DTO transitively. The DTO appears in the lockfile without anyone typing its name, which is precisely why it must be governed explicitly.Compatibility
rr binary version ↔ roadrunner/api-dto version ↔ PHP/Octane version. Re-baseline the DTO column to v2.1.0 as part of this change. Pin the binary (image digest, not :latest) and pin the DTO to an exact or tightly bounded constraint under its new name.rr binary as v2.0.0. This decouples the rename from any runtime upgrade — do not bundle them in one deploy.google/protobuf or the RR-specific runtime package) resolves to a version compatible with the installed ext-protobuf; a mismatch manifests as a boot-time fatal, which is at least loud.Sequencing
rr binary version/digest for all environments. (Unchanged; prerequisite.)spiral/roadrunner-* set has released versions requiring roadrunner/api-dto. If not, pause the rename — an explicit require against a still-old-name worker set creates the split-brain condition.conflict against the old name.composer why roadrunner/api-dto reports exactly one provider, and grep the installed vendor tree for the old package directory to confirm it is absent.Maintenance
Support
Scaling
ext-protobuf. With the C extension, encode/decode cost is negligible even at high RPS; without it, PHP-userland serialization becomes a measurable per-request tax that scales linearly with worker throughput. At Octane-class request volumes this is the difference between "invisible" and "a line item in the profiler."Failure modes
conflict entry and the vendor-tree grep.composer.json or a CI image build script fails to resolve, or worse, quietly resolves the abandoned package alongside the new one.unexpected EOF / invalid-message errors in rr logs immediately after a partial binary/DTO upgrade. Usually 100% failure at boot, which is preferable to partial degradation.ext-protobuf in one environment (carried over): silent codec fallback; no error, just slower. Detect via a startup assertion rather than discovering it in latency graphs.Ramp-up
RoadRunner\DTO\* in a controller, that is a code-review rejection.why, duplicate-install diagnosis), reading protobuf-level errors, and running the lockstep upgrade procedure. This is a one-person, half-day onboarding, not a team-wide skill.How can I help you explore Laravel packages today?