1
I want to send one array
of objects for my controller PHP
and I’ve 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
that’s how it is:
now I wanted to receive this array
in the PHP
controller
like this:
public function postPayment(Request $request)
{
foreach($request->all as $req){
echo '<script type="text/javascript">alert("'$req->name'");</script>';
}
}
But none of this is working, some dirt?
tried to put
var_dump($request->all());
to see what you print?– novic