You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation, the validated methods of both FormRequest and Validator are mentioned in such a way that it seems they function the same (as with a lot of methods in Laravel, which is great!).
However, this implicit similarity is not there.
Only the specific use mentioned in the docs (without parameters) returns the same result. Unfortunately, Validator's validated method can not accept any parameters to just get a single value from the validated request input data.
Suggestion
a. Is it possible to add that optionality to Validator's validated method?
b. If not, it might be more clear to include a note about this difference in the documentation.
This discussion was converted from issue #45311 on December 15, 2022 09:20.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
In the documentation, the
validated
methods of bothFormRequest
andValidator
are mentioned in such a way that it seems they function the same (as with a lot of methods in Laravel, which is great!).However, this implicit similarity is not there.
Only the specific use mentioned in the docs (without parameters) returns the same result. Unfortunately,
Validator
'svalidated
method can not accept any parameters to just get a single value from the validated request input data.Suggestion
a. Is it possible to add that optionality to
Validator
'svalidated
method?b. If not, it might be more clear to include a note about this difference in the documentation.
The difference:
Illuminate\Foundation\Http\FormRequest -> validated($key = null, $default = null)
Illuminate\Validation\Validator -> validated()
Beta Was this translation helpful? Give feedback.
All reactions