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

Command Bus Laravel Package

onliner/command-bus

A lightweight command bus for Laravel that maps commands to handlers, supports middleware pipelines, and lets you dispatch commands synchronously or via the queue. Simple to install, easy to integrate, and flexible enough for growing applications.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: onliner/command-bus implements the command-bus / command-handler pattern for Laravel, which fits cleanly into service-oriented or CQRS-lite architectures. It is most valuable where controllers and jobs currently contain business logic that should be extracted into single-purpose handlers. It is a narrower concern than a full event bus or queue abstraction, so it should be evaluated as a structural refactoring lever rather than a platform component.

Integration feasibility: Low integration cost. It is a Composer package with a single PSR-3 logging dependency change in v1.1.7. Adoption can be incremental — teams can introduce the bus for one bounded context without rewriting existing controllers or jobs. The main unknown is the exact Laravel/PHP version matrix, which should be verified before committing.

Technical risk: Low for this specific release. v1.1.7 only bumps psr/log, which is a standard interface package and carries minimal behavioural risk. The broader risk is package maturity and documentation depth around handler resolution, middleware, transaction boundaries, and failure/retry semantics. A dependency bump alone is not a reason to re-architect, but it is also not evidence of active feature development.

Key questions:

  • Which Laravel and PHP versions are officially supported, and is Laravel 10/11 covered?
  • How are handlers registered — auto-discovery, explicit mapping, or container binding?
  • Does the bus support middleware for transactions, authorization, and logging?
  • What happens when a handler throws — is there retry, dead-lettering, or queue integration?
  • Is there a testing helper or fake bus for unit tests?
  • What is the release cadence and maintainer bus factor?

Integration Approach

Stack fit: Good fit for Laravel applications that want explicit command/handler separation without adopting a heavier framework. It complements, rather than replaces, Laravel's queue, container, and event systems. Teams already comfortable with Laravel service providers and dependency injection will find the mental model familiar.

Migration path: Start with one vertical slice — for example, a single write-heavy domain such as order creation or user onboarding. Extract the existing controller or job logic into a command and handler, wire it through the bus, and leave the rest of the application untouched. Expand only after the first slice proves the pattern and the team is comfortable.

Compatibility: The psr/log bump aligns the package with the PSR-3 ecosystem and should be compatible with Laravel's existing logging stack. Confirm that the package's composer.json constraints do not conflict with the application's Laravel or PHP version. Because the change is at the dependency level, no application code changes are expected.

Sequencing:

  1. Verify version compatibility and run a small proof of concept in a non-critical module.
  2. Define conventions for command naming, handler location, and transaction boundaries.
  3. Add middleware for logging and transactional wrapping before broad adoption.
  4. Migrate one bounded context, measure test coverage and error handling, then expand.
  5. Establish a review checklist so new commands follow the same structure.

Operational Impact

Maintenance: Low ongoing maintenance for the package itself. The operational cost sits in the conventions the team builds around it — handler naming, transaction scope, and error handling. Without those conventions, the command bus can become an inconsistent layer that is harder to debug than direct service calls.

Support: The package appears to be a small, community-maintained library. Support is likely best-effort via GitHub issues. Teams should be prepared to pin versions and, if necessary, fork or wrap the bus behind an internal interface to reduce coupling to the package's API.

Scaling: The command bus itself is an in-process abstraction and does not change horizontal scaling characteristics. Scaling depends on whether commands are dispatched synchronously or through Laravel queues. For high-throughput paths, confirm that handler execution can be queued and that failures are observable.

Failure modes: The main failure modes are unregistered handlers, unhandled exceptions inside handlers, and transaction boundaries that are ambiguous. Logging via PSR-3 helps, but teams should add explicit monitoring around command dispatch and handler failure. Because v1.1.7 only changes a logging dependency, no new failure modes are introduced by this release.

Ramp-up: Low to moderate. Developers familiar with Laravel will learn the command-bus pattern quickly, but the team needs a shared understanding of when to use commands versus services versus jobs. A short internal guideline and one worked example are likely sufficient for onboarding.

Release note assessment: v1.1.7 is a maintenance release containing only a psr/log dependency bump. It does not introduce breaking changes, new features, or deprecations, and does not materially change the adoption decision. The assessment remains valid; the release is a positive signal of basic dependency hygiene but not of significant roadmap activity.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console