Answers for "redirect on validation error laravel to specific section laravel"

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 "redirect on validation error laravel to specific section laravel"

Browse Popular Code Answers by Language