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

micro-module/command-bus

A lightweight command bus for Laravel micro-modules that dispatches commands to their handlers, supports middleware pipelines, and keeps controllers thin by separating request handling from business logic.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The command bus pattern (command DTO → handler → dispatcher → middleware pipeline) is a reasonable fit for modular Laravel monoliths and CQRS-lite designs. It buys you decoupling between the HTTP/controller layer and domain write logic, a single place to attach cross-cutting middleware (transactions, authorization, logging, idempotency), and a clean seam for later extraction to queues.
  • The package name — "Micro module CommandBus common library" — signals its real intended role: a shared contract package so independently versioned micro-module/* packages can dispatch commands to each other without a direct compile-time dependency. That is the only justification that survives scrutiny; if it is merely a dispatcher implementation, it duplicates functionality Laravel already ships.
  • Laravel's own bus (Illuminate\Contracts\Bus\Dispatcher, dispatch(), Bus::chain(), Bus::batch(), the $pipeline middleware array, ShouldQueue) covers dispatch mechanics, middleware, and async transport out of the box and is maintained by the framework. A third-party bus must therefore add conventions — naming standards, payload envelopes, result objects, module routing — or it adds nothing.
  • Material unknown: whether the package is framework-agnostic (PSR-11 container only) or hard-bound to illuminate/*. Framework-agnostic would make it viable as a vendor-neutral contract layer; bound to Laravel 7/8 constraints it is a legacy artifact.

Integration feasibility

  • composer require micro-module/command-bus is trivially shaped, but constraint resolution is the blocker. A release dated 2021-05-18 predates Laravel 9/10/11 and mainstream PHP 8.1+. Expect illuminate/support/illuminate/container capped at ^7|^8, meaning install into a modern application fails or requires --ignore-platform-reqs, replace, or a fork. Those are red flags, not workarounds.
  • Zero stars, zero dependents, and a composite score of 0.03 mean no production validation exists. There is no downstream bug corpus, no issue history to mine, no StackOverflow footprint. You would be the first adopter and would absorb all discovery cost.
  • Small code surface likely limits security exposure — in-process dispatch, no network parsing, no untrusted deserialization — but concentrates risk in abandonment and in whether the abstraction is a leaky re-implementation of the framework's.

Technical risk: high to prohibitive. Single maintainer, four years without release, no published support matrix, unknown test coverage, no security advisory channel, and no successor package.

Key questions to close before any decision

  1. Does it depend on illuminate/*, and at what version ceiling?
  2. Does it define contracts only, or also a dispatcher, middleware pipeline, and queue transport?
  3. What is the behavior when no handler is registered for a command — exception, no-op, or silent null?
  4. Is there a middleware/transaction seam, and does it compose with DB::transaction?
  5. Is the wider micro-module/* family maintained, or is this an orphaned fragment of one person's side project?
  6. Test coverage and CI status; are the interfaces covered by contract tests we could inherit?
  7. Licensing and maintainer continuity — who owns the Packagist namespace?

Verdict: do not adopt. Use Laravel's native bus, and if cross-module contracts are genuinely needed, publish a 100-line internal interfaces package you control.

Integration Approach

Stack fit

  • Fits a Laravel modular monolith or a set of Composer-installed internal modules that need loose coupling. Does not fit multi-service or event-driven architectures — a command bus is a write-side, single-process abstraction; cross-service messaging needs a real transport (SQS, RabbitMQ, Kafka) and idempotency/outbox semantics this package will not provide.
  • If the app is Laravel 9+, treat this package as incompatible until proven otherwise.

Migration path

  • Never let the package's interfaces leak into domain code. Wrap it: define App\Contracts\CommandBus with dispatch(object $command): mixed, bind an adapter, and inject the interface. Swapping to Illuminate\Contracts\Bus\Dispatcher or a fork then becomes a one-line container rebinding.
  • Prefer the inverse: adopt the framework bus now, and only introduce a shared contract package if/when a second consumer module actually appears. Speculative abstraction is the most common failure mode in this pattern.
  • If you must adopt, fork and vendor rather than depend on the upstream tag; pin the fork in composer.json as a VCS repository and treat it as first-party code.

Compatibility

  • Gate on composer why-not micro-module/command-bus, composer outdated, and a dependency audit in CI. Add Larastan/PHPStan at a strict level plus a contract test suite around the interface before any merge.
  • Verify PHP 8.1/8.2/8.3 behavior explicitly — deprecations around dynamic properties and return types are likely in 2021-era code.

Sequencing

  1. Spike on a branch behind the App\Contracts\CommandBus wrapper; timebox to two days.
  2. Static analysis, dependency audit, contract tests against the wrapper.
  3. Compare against a native Laravel bus adapter on the same contract.
  4. Decide on evidence; default to native unless the shared-contract need is concrete and near-term.
  5. If adopted, add a fork-and-own ADR with an explicit review date.

Operational Impact

Maintenance

  • Effectively zero upstream maintenance. Budget for full ownership: security patches, PHP/Laravel major upgrades, and bug fixes on your fork. That is a recurring cost against a package that saves perhaps an afternoon of writing interfaces.
  • No automated dependency updates will help; Dependabot/Renovate will simply report that no compatible version exists.

Support

  • No vendor, no SLA, no triage. Single-maintainer projects with 0 stars rarely respond to issues; assume the issue tracker is a write-only medium.
  • No CVE-monitoring coverage. You become responsible for watching the code yourself, which is feasible only because the surface is small.

Scaling

  • Dispatch is in-process and synchronous; cost is roughly a container resolution plus a handler invocation per command, which is negligible relative to I/O. The scaling constraint is not the bus but what handlers do — long-running handlers on the request path are the real risk.
  • Async execution is the gap: unless the package integrates with ShouldQueue, heavy commands will block requests. Verify this early; it is the most likely reason to reject it.
  • Nested dispatch and circular module dependencies are the architectural scaling limit — a command bus makes cross-module cycles easier to create silently, because callers no longer see the dependency graph.

Failure modes

  • Silent no-op dispatch if handler resolution returns nothing — the worst failure class, because writes vanish without an error.
  • Unhandled handler exceptions bubbling to the HTTP layer without a transaction boundary, leaving partial writes.
  • Container resolution failures surfacing as opaque BindingResolutionException deep in the stack.
  • Version skew: two modules requiring different bus majors, unresolvable in one Composer graph.
  • Abandonment with no successor — the migration cost is deferred, not avoided.

Ramp-up

  • Technically low: the pattern is a well-understood one and a competent Laravel engineer is productive in under a day.
  • Organizationally higher: expect to spend more effort justifying an unmaintained dependency in review than the dependency saves. The friction is governance, not learning curve.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
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