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
I've personally switched over to just using $request->safe() everywhere - meaning I either use $request->safe()->except(['something']) or $request->safe()->all().
I think it would be nice for Laravel 10 if the create/update etc methods could accept an instance of ValidatedData directly and cast it to an array.
public function update(UpdateMyModelRequest $request, MyModel $myModel)
{
- $myModel->update($request->validated());- $myModel->update($request->safe()->all());+ $myModel->update($request->safe());
}
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.
-
I've personally switched over to just using
$request->safe()
everywhere - meaning I either use$request->safe()->except(['something'])
or$request->safe()->all()
.I think it would be nice for Laravel 10 if the create/update etc methods could accept an instance of
ValidatedData
directly and cast it to an array.Beta Was this translation helpful? Give feedback.
All reactions