- What is innmind/command-bus and what does it actually do?
- It is a minimal command-bus abstraction from the Innmind PHP ecosystem: a Command marker, a CommandBus interface, and a dispatcher that maps commands to handlers and passes them through a middleware pipeline. Middleware is the main value, since it lets you wrap concerns like transactions, logging, and validation around handler execution. The package is small and framework-agnostic, and it leans on sibling Innmind packages for its strict typing.
- Is innmind/command-bus compatible with Laravel?
- There is no Laravel service provider, facade, or documented integration, so it does not plug into the framework out of the box. Laravel already ships a first-class bus in Illuminate\Contracts\Bus\Dispatcher with the dispatch() helper, Dispatchable, and ShouldQueue, so adding this package produces a two-bus application. You would have to write the container binding yourself rather than relying on auto-resolution.
- How do I install innmind/command-bus with Composer?
- Run composer require innmind/command-bus, then confirm the version constraints resolve against your PHP baseline and existing Innmind dependencies. Because the package is archived and publishes no test matrix, do a short spike first: install it, autoload the classes, and verify the public API surface before committing. In Laravel you would register the bus manually in a service provider, since no package discovery is provided.
- Does innmind/command-bus support middleware for transactions and logging?
- Yes. A middleware pipeline is the core design idea of the package, letting you intercept a command before and after its handler runs. That is the natural place to implement database transaction boundaries, logging, validation, or authorization. Note that the guarantees themselves are yours to build; the library supplies the interception point, not the transaction handling.
- Which PHP versions does innmind/command-bus support?
- The repository does not publish a test matrix and the package is archived, so there is no verified compatibility statement for PHP 8.2, 8.3, or 8.4. Check the composer.json constraints and confirm they resolve against your current baseline before adopting it. Because it is archived, you should not expect a compatibility release for future versions such as PHP 8.5.
- Does innmind/command-bus support queued or asynchronous command execution?
- It appears to be a synchronous dispatcher: commands are handled in-process, with no documented queue integration, retry semantics, or serialization contract. Laravel's ShouldQueue, Horizon visibility, and queue retries therefore do not reach this path. If you need asynchronous execution, you would have to build it on top of the bus or keep those commands on Laravel's own bus.
- Is innmind/command-bus actively maintained?
- No. The repository is archived, it is authored by a single maintainer, and it has zero dependents and zero stars, meaning no field reports and no ongoing compatibility work. If a defect surfaces or a transitive Innmind dependency changes its API, you become the maintainer whether or not you planned to be. The MIT license makes forking a clean option.
- Should I use innmind/command-bus instead of Laravel's built-in bus?
- Usually no. Laravel's bus already covers container resolution, queues, events, validation, transactions, and test fakes like Bus::fake(), and running a second bus forces engineers to remember which mechanism a given command belongs to. The exception is a deliberately framework-agnostic domain layer where Laravel is only an outer adapter, and even then what you want is the interface idea, which you can define in your own codebase in about a day.
- How do I test commands dispatched through innmind/command-bus?
- There is no equivalent of Bus::fake() and no published testing utilities, so you assert behaviour by swapping in a fake CommandBus implementation or a recording middleware in your test container. Because the bus is an interface, a hand-written test double is straightforward. If your handlers touch framework services, you will also need to bootstrap those dependencies manually since container auto-resolution does not apply.
- What are the alternatives to innmind/command-bus?
- The main alternatives are Laravel's built-in bus with a Command/Handler convention, league/tactician for a framework-agnostic middleware-based command bus, or a small in-house interface plus dispatcher. Given how small this package is, forking or reimplementing the handful of classes you actually need is often cheaper than adopting an archived dependency with an entire ecosystem attached. The permissive MIT license makes either route low-risk.