Method parameters interception in method binding #41948
Unanswered
michael-rubel
asked this question in
Q&A
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.
Uh oh!
There was an error while loading. Please reload this page.
-
We know that the framework has the
method binding
feature. In my opinion, it's very cool stuff and I use it a lot in my projects to be able to override the behavior of any sensitive method in my app in tests or in case of urgent tasks. But there's an edge case when you might want to bind something based on the method's input. This feature currently is unsupported in the framework, and @taylorotwell himself rejected the PR that was introducing this a little time ago.Currently, the bindMethod's closure receives the
$service
and$app
instance.It would be nice if we can use the third argument,
$params
.I've released a package that supports this, but to add features to the container itself I had to override core classes and patch it every Laravel release. Is there a chance that this PR can be re-reviewed, or maybe it's someway possible to introduce this feature without tweaking the entire
Container
andBoundMethod
?Beta Was this translation helpful? Give feedback.
All reactions