Illuminate\Bus\Dispatcher option to customise how a command handler is found #49221
Unanswered
bambamboole
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently it is only possible to add a command => handler mapping by calling the
Illuminate\Bus\Dispatcher::map().We are using a common pattern , where we place a command handler always next to the command. E.g.
App\Foo\BarCommand::classwill be handled byApp\Foo\BarCommandHandler::class.To achieve here, that the
Illuminate\Bus\Dispatcherfinds the handler automatically, I have to override the whole class, since it is not customisable how this works.My idea was, to add the option to configure a
commandHandlerResolvercallback, which is then called in thegetCommandHandlermethod ofIlluminate\Bus\Dispatcher.Would you accept a PR to add this feature?
Beta Was this translation helpful? Give feedback.
All reactions