- What does micro-module/tactician-command-events actually do?
- It is a small utility package that layers command lifecycle events on top of the framework-agnostic League Tactician command bus. Instead of only executing a command handler, the bus also emits events around the command's journey so you can hook in logging, metrics, or side effects. It does not replace Tactician and it does not add a Laravel-native command bus. Think of it as an event-emitting middleware layer for teams already standardizing on league/tactician.
- How do I install and register micro-module/tactician-command-events?
- Install it with Composer alongside league/tactician, then attach the package's middleware to your Tactician command bus during bootstrap. There is no documented Laravel service provider or configuration file, so registration is manual and typically happens wherever you build your CommandBus instance. In Laravel that usually means a small custom service provider that constructs and binds the bus. Verify the middleware signature against your installed Tactician major version before wiring it in.
- Do I need a Laravel service provider or config file for this package?
- No first-party Laravel service provider or configuration surface is documented for this package. It was built for a framework-agnostic command bus, so any Laravel integration is something you write yourself. That means binding the bus, registering middleware, and deciding how events reach Laravel's dispatcher are your responsibility. Budget a short spike to confirm the wiring works before adopting it broadly.
- Which Laravel and PHP versions does this package support?
- The package has not had a release since May 2021, so its Composer constraints likely target PHP 7.x and older Laravel versions. There is no published evidence of PHP 8.1+ or Laravel 10/11 compatibility work. Check the composer.json constraints and expect to patch them or vendor the code for modern stacks. Running a throwaway install in a scratch branch is the fastest way to find out.
- Is micro-module/tactician-command-events safe to use in production?
- Treat it with caution. The package has zero stars, zero dependents, and no release since 2021, which means no community validation and no recent security or compatibility patching. The code surface is probably small enough to fork or reimplement internally, which lowers direct dependency risk but shifts ownership to your team. If you adopt it, pin it through a path or VCS repository and plan to maintain it yourself.
- Which Tactician versions does it work with, v2 or v3?
- The documentation does not state a supported Tactician major version, and the 2021 release date suggests it was written against the middleware signatures available at that time. Tactician middleware interfaces have changed across majors, so you should confirm compatibility explicitly. If signatures do not match, expect to adapt the middleware or fork it. Test against the exact league/tactician version you pin in composer.json.
- Can I replace this package with my own Tactician middleware?
- Yes, and for most teams that is the recommended path. A custom middleware that wraps command execution in try/catch and dispatches pre-handle, post-handle, and failure events is a small, well-understood piece of code. Writing it yourself gives you full control over the event contract, exception behaviour, and PSR-14 compatibility. It also removes an unmaintained dependency from your supply chain.
- How are listener exceptions and failed commands handled?
- The package does not document its exception semantics, so you must verify whether a throwing listener aborts command execution or is swallowed. This matters most on the failure path, where you typically want the original exception to propagate while listeners only record telemetry. Write explicit tests that throw from a listener and assert the command outcome. If the default behaviour is unsafe, wrap the dispatcher inside your own middleware instead.
- Does dispatching command events hurt performance or transaction safety?
- Every command now pays for one or more extra event dispatches, and synchronous listeners widen the time spent inside any open database transaction. If listeners enqueue jobs, command retries can produce duplicate events, so make downstream handlers idempotent and deduplicate on a command identifier. Measure event volume before rolling this out on high-throughput command paths. Keeping listeners fast and non-blocking is the simplest mitigation.
- What are the Laravel-native alternatives to this package?
- Laravel ships events, model observers, queue and job events, and middleware that cover most command lifecycle needs without a third-party dependency. Many teams also wrap their command bus in a custom middleware that fires Laravel events directly. If you are not already committed to league/tactician, using Laravel's dispatcher and job hooks is the lower-risk choice. This package only makes sense as a reference implementation when Tactician is already your standard.