Skip to content

Conversation

@istiak-tridip
Copy link
Contributor

Although the ActionRequest::validated method accepts the $key and $default parameters (for FormRequest compatibility), these parameters are not used as implemented in Laravel (#36807).

This PR fixes that.

Previous Behavior:

public function handle(ActionRequest $request) {
    $validated = $request->validated(); // Returns an array

    $password = $request->validated('password'); // Still returns an array
}

New Behavior:

public function handle(ActionRequest $request) {
    $validated = $request->validated(); // Returns an array

    $password = $request->validated('password'); // Still returns the validated `password` field's value
}

@lorisleiva lorisleiva merged commit 0f765b3 into lorisleiva:main Dec 9, 2022
@lorisleiva
Copy link
Owner

That's a very good point. Thanks for your contribution! 🍺

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