I am trying to redirect user to different page after Unique validation fails
class RegisterController extends Controller
{
use RegistersUsers;
protected function validator(array $data){
$validator = Validator::make($data, $rules, $messages);
// If unique validation fails
if($validator->fails()){
$failed = $validator->failed();
// if failed because unique mobile number validation rule
return redirect('/somepage');
}
return $validator;
}
}
when I try to do this, it give error
BadMethodCallException in RedirectResponse.php line 218:
Method [validate] does not exist on Redirect.
How can I redirect to some other page? am I missing something.
via Straw Hat