Skip to content

[12.x] Fix handling of default values for route parameters with a binding field #55697

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

stancl
Copy link
Contributor

@stancl stancl commented May 9, 2025

This fixes a case where you set a default value for a route parameter with a binding field (tenant:slug) but not for that same parameter without a binding field (tenant).

I overlooked this in my original PR, essentially a false positive due to the structure of the tests (all defaults were always set). Now I temporarily remove the default value while repeating some assertions. Can confirm the tests fail without the fix. And the fix just makes sure to check the right default (with the binding field in mind).

…eld, where a default is not present for that same parameter without a binding field
@taylorotwell taylorotwell merged commit aa6538e into laravel:12.x May 9, 2025
60 checks passed
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.

2 participants