redirect on validation error laravel to specific section laravel

Solutions on MaxInterview for redirect on validation error laravel to specific section laravel by the best coders in the world

showing results for - "redirect on validation error laravel to specific section laravel"
Kourtney
23 Jan 2018
1$validator = Validator::make($request->all(), [
2  'name' => 'required',
3]);
4
5if ($validator->fails()) {
6  return redirect()->to(url()->previous() . '#section')->withErrors($validator)->withInput();
7}