Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[5.5] Optional parameter binding #17521
(References Issue #13988)
Following @powelski 's reasoning, the behavior as implemented would be:
(PR submitted to master even though it was tagged [5.3], for backwards compatibility)
referenced this pull request
Jan 24, 2017
@taylorotwell you mean #16926? I guess there's some overlap (in fact I see now we have a conflict in a method) but this one was directed specifically at what we've been discussing at #13988, regarding the implicit binding of Eloquent models when the route as well as the controller method are defined with optional parameters.
@JosephSilber well, mostly for consistence with the current behavior. From the docs:
If you want to do custom things, you can always customize the exception handler, or bind explicitly.
As I see it, optional parameter should mean "what to do when no parameter is supplied" (that is, bind
@taylorotwell Sure. I just tried this in a 5.3 application: