title: Laravel 5: Retrieve JSON array from $request
body: <p>I'm a Laravel newbie and I'm converting a php/jquery app to Laravel. The original code used a JSON array with an ajax POST, which was retrieved like this:</p>
  
  <pre><code>$json = file_get_contents('php://input');
  $data = json_decode($json,true);
  </code></pre>
  
  <p>I'm doing much the same thing on the POST side, but I don't see any data coming through in my Laravel $request collection. Is there something special that I need to do to retrieve JSON data structured like this:</p>
  
  <pre><code>[
      { "name": "John", "location": "Boston" }, 
      { "name": "Dave", "location": "Lancaster" }
  ]
  </code></pre>
  
  <p>Here is my jQuery ajax POST code (with hard coded data)</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/people",
      data: '[{ "name": "John", "location": "Boston" }, { "name": "Dave", "location": "Lancaster" }]',
      dataType: "json",
      success:function(data) {
          $('#save_message').html(data.message);
      } 
  });
  </code></pre>
  
  <p>Here is the code in my Controller that receives the POST</p>
  
  <pre><code>public function store(Request $request)
  {
      dd($request-&gt;all());
  }
  </code></pre>
  
  <p>But all I get is:</p>
  
  <blockquote>
    <p>[]</p>
  </blockquote>
  
  <p>Any ideas on how I can retreive my data?</p>