In Laravel 5 there was a function formatValidationErrors() that allowed you to format error messages. The application I am updating to Laravel 8 used this to take the validator errors and flashed it to Session. Is there an equivalent for this in Laravel 8? I can't find in the docs.
protected function formatValidationErrors(Validator $validator)
{
if($validator->errors()->all()) {
Session::flash('error', $validator->errors()->all()[0]);
}
return $validator->errors()->all();
}