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.3] Added spec and fix for Router implicit binding through IoC #16802

Merged
merged 2 commits into from
Dec 15, 2016

Conversation

asutoshpalai
Copy link
Contributor

@asutoshpalai asutoshpalai commented Dec 14, 2016

If a Model has been bound to another one though $this->app->bind('Model1', 'Model2'), the implicit binding for the old model in the controllers still resolves to the old model rather than the one it's bound to.

This fixes it.

@taylorotwell
Copy link
Member

Why do you have an Eloquent model aliased to another model name?

@asutoshpalai
Copy link
Contributor Author

I was building a core Laravel application as a package. This core application is to be used in other applications which should be able to override the features provided by the package.

To allow overriding (extending) the package's Models by the application and use the extended one inside the package, I was using dependency injection and IoC container. It is working everywhere except at implicit model bindings in the controllers.

@taylorotwell taylorotwell merged commit f880e09 into laravel:5.3 Dec 15, 2016
@GrahamCampbell GrahamCampbell changed the title Added spec and fix for Router implicit binding through IoC [5.3] Added spec and fix for Router implicit binding through IoC Dec 15, 2016
@asutoshpalai asutoshpalai deleted the implicit-ioc branch December 15, 2016 16:51
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.

None yet

2 participants