illuminate/bus
Laravel's command bus component. Dispatch jobs and commands through a central pipeline with support for synchronous handling, queue dispatching, and middleware-style pipes that wrap execution. Includes the dispatch() helper and Dispatchable trait used throughout Laravel.
Feature architecture: build vs. buy for command orchestration. The command bus is a solved problem inside Laravel, so the build-vs-buy decision collapses to "do we adopt the framework's native bus or hand-roll a service layer?" Choosing illuminate/bus avoids maintaining bespoke orchestration code while giving you middleware, queue dispatch, and handler resolution for free — the package is MIT-licensed and shipped with the framework, so it carries no procurement, licensing, or vendor-contract overhead.
Roadmap: staging complexity against delivery speed. The bus pattern pays off when workflows grow (multi-step checkout, onboarding, provisioning, billing retries). It lets the team defer building an internal workflow engine by using queued commands plus chaining (chain(), onQueue()) as the orchestration primitive. Conversely, if the roadmap is mostly CRUD and read-heavy screens, adopting the bus is premature structure that will slow delivery.
Cross-cutting requirements get a single enforcement point. Validation, authorization, audit logging, and correlation IDs become bus middleware applied uniformly rather than re-implemented per controller. This is the strongest product argument: it turns compliance and observability asks from "sprinkle it everywhere" into "one pipeline, one review."
Scalability decisions without re-architecture. Making a command implement ShouldQueue moves work off the request cycle with no product-facing redesign. That gives you a lever for p95 latency and throughput that is a one-line change, not a roadmap item — useful when traffic forecasts shift mid-quarter.
Domain boundaries and team scaling. Commands map cleanly onto business capabilities (ProcessOrder, GenerateInvoice), giving product and engineering a shared vocabulary for features. That alignment pays off when multiple squads touch one codebase or when you need to isolate, audit, or later extract a domain.
Testability as a planning input. Bus::fake() lets integration tests assert intent ("this command was dispatched") separate from side effects. For a PM this means faster, less brittle regression suites — directly affecting release cadence and the cost of each sprint's QA.
What it explicitly does not decide: it does not buy you a message broker, a Saga/workflow engine, or cross-service eventing. If the roadmap includes multi-service orchestration or non-PHP consumers, treat this as an in-process tool and budget a separate decision (e.g., Symfony Messenger, a queue-backed event bus, or a dedicated workflow service).
Adopt when:
illuminate/* ^13.0). Anything older means an upgrade project precedes adoption.ShouldQueue, queue workers, Bus::fake()). Skill fit is the single largest determinant of whether this accelerates or confuses.Look elsewhere when:
Decision questions to put in the PRD: Which two or three workflows justify the pattern? Does the team already run queue workers in production with alerting? Is the framework version current? Are there non-PHP or non-Laravel consumers on the horizon?
One-line summary: We get a production-grade, zero-cost command orchestration layer that is already part of our framework — no license, no vendor, no new infrastructure — and it lets us ship complex workflows faster without building a custom orchestration layer.
For executives: This is not a new dependency; it is an existing component of Laravel we are choosing to use deliberately rather than ignore. Cost is engineering time only. The business return is threefold: faster delivery of multi-step features, a single auditable place to enforce validation, permissions, and logging, and the ability to absorb traffic spikes by moving work to background queues without re-architecting. The primary risk is misapplication — using it for trivial features — which we mitigate with a short adoption guideline rather than a broad mandate.
For engineering: It is the framework-native implementation of the command bus, tightly integrated with the service container, queue system, and event dispatcher. We adopt it incrementally: start with synchronous dispatch for one real workflow, add middleware for logging/validation once the pattern is proven, then flip specific commands to ShouldQueue for async. Key cautions we will document: handler naming conventions must match or handlers silently fail to resolve; handle() parameters need strict types; Bus should come via injection or the facade, not container resolution; version alignment with the framework is mandatory; and queued commands need monitored workers. Testing is a strength — Bus::fake() gives us intent-level assertions and faster suites.
Ask: Approve a scoped pilot on one or two workflows this cycle, plus a lightweight one-page internal guideline (when to use a command, naming, middleware, queue operations). We will review delivery velocity and incident profile after the pilot before broadening adoption across squads.
How can I help you explore Laravel packages today?