title: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource not working
body: <p>I'm new to Laravel and have gone through several solutions on tackoverflow, but to no avail. It's still showing the same error of Cross-Origin Request Blocked.</p>
  
  <pre><code>$(".cmd_submit").click(function(){
  $.ajax({
      //crossOrigin: true,
      //header:{'Access-Control-Allow-Origin': '*'},
      type: 'POST',
      url:  'http://localhost/members/register',
      data: $('#form_reg').serialize(),
      success: function(data){
         alert(data);
      },
      error: function(data){
    alert(data);
      }
  </code></pre>
  
  <p>I also included this:</p>
  
  <pre><code>&lt;?php header("Access-Control-Allow-Origin: *"); ?&gt;
  </code></pre>
  
  <p>on my app.blade.php, but it still didn't work.</p>