Receive an array of objects in a php driver

1

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:

  

NowIwantedtogetthisarraynoPHPcontrollertypethis:

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?

    
asked by anonymous 06.02.2018 / 18:05

0 answers