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
Cqrs Handler

Cqrs Handler Laravel Package

lmc/cqrs-handler

Laravel CQRS handler package that simplifies command and query buses with automatic handler resolution, dependency injection, and clean separation of write and read logic. Ideal for structuring growing applications with maintainable, testable business actions.

View on GitHub
Deep Wiki
Context7

This library contains a base implementation for CQRS/Types

Frequently asked questions about Cqrs Handler
What is lmc/cqrs-handler used for in a Laravel application?
It provides lightweight CQRS contracts and thin abstractions for separating write commands from read queries and routing each command or query to a dedicated handler. In Laravel, you typically add a small adapter that resolves handlers from the service container so controllers stay thin. It does not ship a Laravel service provider, handler discovery, or a full bus implementation, so you own that wiring.
How do I install and configure lmc/cqrs-handler in Laravel?
Install it with Composer using composer require lmc/cqrs-handler, then implement the package interfaces on your command and query DTOs and write handler classes. You then add a small adapter or resolver that pulls handlers from Laravel's container and dispatches commands or queries through it. Before committing, verify the package's PHP and Symfony constraints in composer.json and run a short spike.
Does lmc/cqrs-handler include a command bus or Laravel service provider?
No. The package is best understood as a base implementation of CQRS types: contracts and thin abstractions for commands, queries, and handlers, not a framework. It does not provide a Laravel service provider, automatic handler discovery, or a concrete bus implementation. You still need to supply the adapter that resolves handlers from Laravel's container, which is typically about one to three engineer-days for a proof of concept.
Is lmc/cqrs-handler compatible with Laravel 10, 11, and 12 on PHP 8.1+?
The integration assessment targets Laravel 10, 11, and 12 on PHP 8.1+, but compatibility must be confirmed against the package's own Composer constraints. The 2.3.0 release adds Symfony 8 support, and Symfony 8 targets PHP 8.4, so check whether symfony/* is optional or a hard require. If Symfony support is correctly optional, integration cost is unchanged; if it forces a PHP floor increase or unwanted Symfony packages, treat it as a blocker for PHP 8.1 to 8.3 shops.
Does Symfony 8 support in lmc/cqrs-handler 2.3.0 change PHP or dependency requirements?
It might, so this is a mandatory feasibility check before adoption. Confirm whether symfony/* appears in require, require-dev, or suggest, and inspect the package's php constraint after 2.3.0. Also check the Symfony constraint syntax, because a hard ^8.0 would drop older Symfony compatibility, while ^7.0|^8.0 is more permissive. Run composer why symfony/console or an equivalent command in your spike.
How does lmc/cqrs-handler compare with Laravel's native command bus?
The package is a convention layer for command/query-to-handler mapping, not a replacement for Laravel's native bus. Laravel's bus handles dispatching, queueing, and framework integration, while lmc/cqrs-handler focuses on the CQRS vocabulary and thin handler abstractions. They can be complementary if you wire the package's handlers through your own adapter, but evaluate whether Laravel's native bus already covers your needs.
Is lmc/cqrs-handler production-ready and widely adopted?
Adoption signals are still effectively nil, with about one star and zero dependents, so there is little ecosystem validation. The 2.3.0 feature release is a better maintenance signal than star count because it shows someone is tracking upstream framework releases, but release metadata has an anomaly that should be verified against Packagist tags and CI. The MIT license, small surface area, and low blast radius make it forkable in a day, but that is risk mitigation rather than proof of production readiness.
How do I test handlers built with lmc/cqrs-handler?
Because the package centers on decoupled command/query DTOs and handler classes, you can unit test handlers directly by instantiating them with stubbed dependencies. Add an integration test for the small Laravel container adapter that resolves and invokes handlers. Keep cross-cutting concerns such as transactions, logging, and authorization in middleware or decorators so handler tests stay focused.
Can I use middleware for transactions, logging, and authorization with lmc/cqrs-handler?
The package advertises middleware or pipeline support for cross-cutting concerns, which is the right place for transactions, logging, and authorization. In Laravel you must confirm the available extension points and wire them through your adapter without patching the package. If the extension points are sufficient, these concerns can stay out of individual handlers; if not, decorators around your dispatch layer are the fallback.
Is lmc/cqrs-handler maintained, and what are the alternatives?
The 2.3.0 release with Symfony 8 support is a meaningful counter-signal to abandonment, but low stars, zero dependents, and no Laravel-specific integration path mean you should verify tags and CI yourself. Alternatives include Laravel's native bus plus your own CQRS conventions, a custom in-house command/query layer, or another maintained CQRS package. Given the MIT license and small surface area, forking or wrapping lmc/cqrs-handler is also viable if the abstractions fit.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo