Currently I am able to pass my form data via ajax to my controller to insert into db. This works fine and after insert I will get data from the controller and pass to another controller only after this ajax is success. Currently stucked here cause I am using this method window.location.href.
$.ajax({
method: "POST",
url: "{{ URL::asset('paysubmit') }}",
data: {eID:eID,amount:amount,"_token": "{{ csrf_token() }}" },
success: function(data) {
window.location.href = "{{ URL::asset('/cds') }}";
}
In the paysubmit controller currently I am using this method return view('cds')->with($data);
but I need to do this in this ajax cause this codes are in php? I need to improvise on this window.location.href = "{{ URL::asset('/cds') }}";
?