Skip to content

Conversation

@benholmen
Copy link
Contributor

When interacting with FormRequests and using validated data it's a little clunky to get single values. This PR extends the current FormRequest@validated method to make this more expressive.

You can currently get a single validated value with the following:

// this does not seem obviously validated:
$name = $request->input('name');

// ouch
$name = $request->validated()['name'];

I think it's more expressive and clean to use:

$name = $request->validated('name');

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