Closed ksassnowski closed 1 year ago
To me this looks very interesting and promising. I would definitely be open to merge this but @lorisleiva has the final saying on this.
Hiya! I like that approach a lot. Flexible yet transparent to the package. Looking forward to your PR. 🍺
Published as v2.5.1
. Thanks again! 🎉
This is related to #145
I'd like to create a PR that allows users to override which decorator classes should be used when using actions as jobs. This would allow a package like Venture, for example, to provide first-party integration with Laravel Actions without the user having to change their actions in any way.
The API could be similar to what Cashier–and for that matter, Venture itself–does to allow users to provide custom models. Here's a suggestion of what this might look like:
Venture could then provide a
Venture::useLaravelActions()
method to register the necessary decorators in order to make the two packages compatible with each other. Users should then be able to use actions from this package as jobs in their workflows without any other changes.The only thing that really needs to change as far as Laravel Actions is concerned, is replacing the hardcoded references to
JobDecorator
andUniqueJobDecorator
with something likeActionManager::$jobDecoratorClass
.Let me know if this works for you and I can submit a PR for this!