title: Ajax request to Laravel 4 returns 200 ok but method always return fail
body: <p>IM doing i simple request to a Laravel web service.</p>
  
  <p>This is the response in the controller:</p>
  
  <pre><code>data = array(
   'name' =&gt; 'Dummy',
   'size' =&gt; 'XL',
   'color' =&gt; 'Blue'
   );
   return Response::json($data);
  </code></pre>
  
  <p>Using POSTman i can see that everything looks fine:
  URL: </p>
  
  <pre><code>Response:
  {"name":"Dummy","size":"XL","color":"Blue"}
  
  HEADERS:
  Cache-Control →no-cache
  Connection →Keep-Alive
  Content-Type →application/json
  Date →Mon, 04 Nov 2013 15:15:27 GMT
  Keep-Alive →timeout=5, max=100
  Server →Apache/2.4.6 (Ubuntu) PHP/5.5.3-1ubuntu2
  Transfer-Encoding →chunked
  X-Powered-By →PHP/5.5.3-1ubuntu2
  </code></pre>
  
  <p>Then i go to a simple javascript call, like:</p>
  
  <pre><code>$.getJSON("http://localhost/myapi/public/content", function(json) {
                  console.log("log " + json.name);            
              });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$.ajax({ 
  type: 'get', 
  url: 'http://localhost/myapi/public/content',
   dataType: 'json', 
  async: false, 
  success: function(data) { alert("success"); }, 
  error: function() { alert("error"); } });
  </code></pre>
  
  <p>Firefox console returns a "200 OK", but Javascript always report an error.</p>
  
  <p>where is the problem??</p>
  
  <p>SOLUTION:</p>
  
  <p>Laravel Response is not sending by default </p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  </code></pre>
  
  <p>Just added and now im getting the json data correctly.</p>