Form Requests for validation redirection

when using Form Requests for validation, by default the validation error will redirect back to the previous page, but you can override it. Just define the property of $redirect or $redirectRoute.

Link to docs

1// The URI that users should be redirected to if validation fails./
2protected $redirect = '/dashboard';
3 
4// The route that users should be redirected to if validation fails.
5protected $redirectRoute = 'dashboard';

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord