I am trying to output errors on my form validation using this two codes:
if ($validator->fails()) {
return redirect('/')
->withInput()
->withErrors($validator);
}
and
if ($validator->fails()) {
return redirect('/')
->withErrors($validator);
}
they are doing exactly the same thing as what I'm trying to do with my application. Can any body explain it why? if possible with reference.