I want to send array
of objects to my controller PHP
and I have done it this way
$http({
method: 'POST',
url: "payment/pagamento",
data: $.param(vm.listProdsCar),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(response) {
console.log(response);
}).error(function(response) {
console.log(response);
});
My array vm.listProdsCar
looks like this:
NowIwantedtogetthisarray
noPHP
controller
typethis:
publicfunctionpostPayment(Request$request){foreach($request->allas$req){echo'<scripttype="text/javascript">alert("'$req->name'");</script>';
}
}
But none of this is working, are there any issues?