Command bus middleware #50598
Unanswered
remipelhate
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.
-
Hi team! I'm not sure how many people are using Laravel command bus these days, but I've loved it ever since it was added in Laravel 5.x.
I was thinking it could be nice to add support for command bus middleware in a similar fashion to Queued jobs middleware:
I know this can already be achieved using
Illuminate\Contracts\Bus\Dispatcher::pipeThrough()
, but defining the middleware on the command itself has the advantage of not having to redefine the same logic when the command is dispatched through different entry points. And it would be consistent with the queued jobs implementation :)If there is any interest, I have implemented this in a project recently using a globally registered command bus pipe. I can easily extract it and setup a PR.
Thanks for your feedback 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions