Answers for "laravel redirect on validation error"

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 redirect on validation error"

Browse Popular Code Answers by Language