- What is lmc/cqrs-types used for in Laravel?
- It provides lightweight CQRS contracts and base types for commands, queries, handlers, buses, and identifiers. In a Laravel app it helps controllers dispatch explicit command or query objects while handlers own application logic. It is not a runtime framework by itself, so you use it with lmc/cqrs and typically lmc/cqrs-bundle for wiring.
- Do I need lmc/cqrs and lmc/cqrs-bundle to use lmc/cqrs-types?
- In practice, yes. lmc/cqrs-types is the contract layer and provides no runtime buses or handler execution on its own. lmc/cqrs supplies the implementation and lmc/cqrs-bundle supplies Laravel or Symfony container wiring. Verify that all three resolve together before committing.
- Which Laravel and PHP versions does lmc/cqrs-types support?
- The package is Composer-installable and PSR-4, but the exact PHP, Symfony component, and PSR/Illuminate constraints must be checked in its composer.json. There are zero known dependents, so there is no public tested integration matrix. Validate resolution against your Laravel and PHP targets, such as PHP 8.2 or 8.3, and run PHPStan at your strictest level.
- Is lmc/cqrs-types a full CQRS framework or event sourcing library?
- No. lmc/cqrs-types is a contract layer for commands, queries, handlers, and bus abstractions, not a full CQRS framework. It does not provide event sourcing, sagas, projections, replay, or durable messaging. It fits teams that want explicit command/query separation without adopting a heavy framework.
- How do I install and configure lmc/cqrs-types in Laravel?
- Install it with Composer as lmc/cqrs-types, then add lmc/cqrs for runtime buses and usually lmc/cqrs-bundle for Laravel container wiring. The types package has no migrations, persistence, or configuration of its own. Confirm the service provider and handler registration approach in the bundle, or compose buses yourself if you prefer.
- Does lmc/cqrs-types support queues and async command dispatch?
- The types package does not define a transport, so async dispatch depends on lmc/cqrs and your chosen queue or Symfony Messenger setup. The command and query identifier design may support correlation IDs and idempotency keys, but confirm that against the implementation. Test queue serialization, retries, and transaction boundaries in a spike before production.
- How should I test handlers built with lmc/cqrs-types?
- Handlers have simple, predictable signatures, so unit tests can instantiate a handler with mocked dependencies and invoke handle with a command or query object. Add integration tests for the bus wiring, container resolution, and transaction boundaries. No special test harness is shipped with the types package, and PHPStan is useful for catching signature drift.
- What are the risks of using a package with one star and zero dependents?
- The main risk is adoption rather than code complexity: one star, zero dependents, no issue corpus, and effectively a single maintainer. The last release noted is January 2024, so confirm whether lmc/cqrs is actively maintained. The code is thin and mostly pure types, so abandonment has a small blast radius. Bound it behind your own CQRS ports so a fork or replacement stays contained.
- Can I use lmc/cqrs-types without Laravel or with Symfony?
- Yes. The contracts are framework-agnostic and do not couple domain code to Laravel or a transport. Laravel integration comes through lmc/cqrs-bundle, and the same stack supports Symfony wiring. Check the Symfony component and PSR constraints if you are not on Laravel.
- What alternatives to lmc/cqrs-types should I consider for CQRS in Laravel?
- Consider Laravel's built-in command bus and queues, Symfony Messenger, Tactician, or fuller CQRS and event-sourcing frameworks such as Ecotone or Prooph if you need projections and replay. lmc/cqrs-types is intentionally minimal and only makes sense with its sibling runtime packages. Compare maintenance posture, community size, and feature scope before choosing it for a long-lived production system.