Answers for "redirect with validation errors in 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 with validation errors in laravel"

Browse Popular Code Answers by Language