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

[9.x] Use route parameters in view #42461

Merged
merged 3 commits into from
May 20, 2022
Merged

[9.x] Use route parameters in view #42461

merged 3 commits into from
May 20, 2022

Conversation

yoeriboven
Copy link
Contributor

@yoeriboven yoeriboven commented May 20, 2022

Route::view('route/{parameter}', 'view');

I expected $parameter to be available in the view.
There is also a test which makes it seem like it is the expected behavior.

This will actually throw an exception:

Undefined variable $parameter

This PR fixes this.

It takes all function parameters, removes the default values and adds them to the view's data.

@taylorotwell taylorotwell merged commit 7446089 into laravel:9.x May 20, 2022
@jasonmccreary
Copy link
Contributor

@taylorotwell, since this has been merged, what do we think about revisiting #40192 (this, but for implicitly bound models)?

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