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::class
will be handled byApp\Foo\BarCommandHandler::class
.To achieve here, that the
Illuminate\Bus\Dispatcher
finds 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
commandHandlerResolver
callback, which is then called in thegetCommandHandler
method ofIlluminate\Bus\Dispatcher
.Would you accept a PR to add this feature?
Beta Was this translation helpful? Give feedback.
All reactions