I am trying to make a post request of json to Laravel. The request is received on the server however when I try to access a property I get: "Trying to get property of non-object". On the client I'm using angularjs.
angular:
$http.post($rootScope.globals.basePath+"login/handleAjax",{"id" : obj.values[0].id,"profileUrl" : obj.values[0].publicProfileUrl}).success(function(data){
console.log("got success!",data);
});
laravel:
class LoginController extends BaseController {
/*User logs in to linkedin and sends his id through ajax to this function*/
public function handle_ajax() {
$data = Input::all();
*//Clockwork is just a debugging extension I'm using*
Clockwork::info($data->id); **//"Trying to get property of non-object".**
}
Note: I can see in Fiddler that the JSON being sent is valid and that it reaches the controller+method (http 200).
The post request itself (As seen with Fiddler)
Headers:
Accept: application/json, text/plain, */*
...
Text View:
{"id":"my id","profileUrl":"http://www.linkedin.com/pub/yoel-blum/51/373/76"}