Answers for "laravel validation fail redirect"

PHP
2

redirect on validation error laravel to specific section laravel

$validator = Validator::make($request->all(), [
  'name' => 'required',
]);

if ($validator->fails()) {
  return redirect()->to(url()->previous() . '#section')->withErrors($validator)->withInput();
}
Posted by: Guest on July-10-2021

Code answers related to "laravel validation fail redirect"

Browse Popular Code Answers by Language