Only retrieve validated data from $request->validate()

Posted 11 months ago by Cruorzy

So sometimes I call my validation after a few checks, so i have a FormRequest with the rules and made a static function in there that return the rules.

But when I do

$data = $request->validate(CostCreate::getRules());
return $data;

I get more data than expected, I expect only the validate data but instead I get ALL the columns.

Any idea how I get only the validated data?

Please sign in or create an account to participate in this conversation.