Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] Document contextual binding unavailability for method injection #4798

Closed
wants to merge 4 commits into from
Closed

[5.7] Document contextual binding unavailability for method injection #4798

wants to merge 4 commits into from

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Nov 29, 2018

Method injection sent in by Adam here wasn't documented yet. I've also added a note that contextual binding isn't supported for this because this was causing some confusion. See laravel/framework#23602

@taylorotwell
Copy link
Member

I think I'm just going to avoid documenting this for now to be honest. I think it's a little complicated and it's simpler to just pass any primitive dependencies through the constructor.

@driesvints driesvints deleted the method-injection branch December 3, 2018 10:08
@driesvints driesvints restored the method-injection branch December 3, 2018 14:26
@driesvints driesvints reopened this Dec 3, 2018
@driesvints
Copy link
Member Author

@taylorotwell re-opened this with the changes we discussed.

@driesvints driesvints changed the title [5.7] Method injection [5.7] Document contextual binding unavailability for method injection Dec 3, 2018
@taylorotwell
Copy link
Member

Went ahead and just added the bindMethod example. 😄

@driesvints driesvints deleted the method-injection branch December 5, 2018 14:40
@driesvints
Copy link
Member Author

@taylorotwell haha no worries. Thanks for adding it!

@michael-rubel
Copy link

If someone's interested in the feature, I've created a package that let us use method bindings with ease:
https://github.com/michael-rubel/laravel-enhanced-container

I also plan to extend the package functionality in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants