seahorse / aura-di-tactician
A simple aura/di container config for league/tactician
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/seahorse/aura-di-tactician
Requires
- league/tactician: ~1.0
- league/tactician-container: ~2.0
This package is not auto-updated.
Last update: 2025-10-04 01:19:00 UTC
README
A simple aura/di container config for league/tactician.
Add Seahorse\Tactician\Config
to your ContainerBuilder.
League\Tactician\CommandBus
has the service name league:tactician/commandbus
Mapping commands to handlers
In your ContainerBuilder
configuration class you need to map commands to handlers.
$di->set('service-name', $di->lazyNew('Your\Handler')); $di->values['commandsToHandlersMap'] = [ YourCommand::CLASS => 'service-name', ];
Adding middleware
Override the middleware params in your ContainerBuilder
configuration class.
$di->params['League\Tactician\CommandBus']['middleware'] = $di->lazyArray([ // add your middleware, order is important $di->lazyNew('League\Tactician\Plugins\LockingMiddleware'), $di->lazyNew('League\Tactician\Handler\CommandHandlerMiddleware'), ] );