title: AJAX post not sending data to laravel controller
body: <p>Maybe this is a very common topic, but i can't find any solution!, the app i'm developing is under Laravel 5.0, i need to send some data from jquery <strong>ajax</strong> to a laravel <strong>controller</strong>, i've followed <a href="http://tutsnare.com/post-data-using-ajax-in-laravel-5/" rel="noreferrer">this</a> tutorial to post data using ajax, i've followed the steps and made the global configuration, so that i have a meta with the <strong>csrf</strong> token, when i send the post request to a url using ajax, it just sends the token!! but nothing of the data i give it to send!</p>
  
  <p>Here's my ajax func (i'm using dummy data to test it):</p>
  
  <pre><code>        $.ajax( {
              url        : '/reservacion/paso-uno/enviar',
              method     : 'post',
              data       : { name: "John", location: "Boston" }
          } );
  </code></pre>
  
  <p>but when i <strong>dd(\Request::all());</strong> in the post func i only get the token, also if i check the headers form data i only get this:</p>
  
  <p><a href="https://i.stack.imgur.com/sUq9O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sUq9O.png" alt="data sent through the post"></a></p>
  
  <p>Here's a complete image of the headers:
  <a href="https://i.stack.imgur.com/i5JLc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i5JLc.png" alt="headers"></a></p>
  
  <p>Here's the meta tag with the csrf:</p>
  
  <pre><code>&lt;meta name="_token" content="{{{ csrf_token() }}}"/&gt;
  </code></pre>
  
  <p>And here's the global ajax setup:</p>
  
  <pre><code>$.ajaxSetup({
                  headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }
              });
  </code></pre>
  
  <p><strong>BIG UPDATE</strong></p>
  
  <p>Don't know why, neither how, i guess it was just a cache problem, but having the above configuration it sends data, but that happens only when i have a <code>&lt;input type='submit' &gt;</code> and in jquery setup the click event, because if i setup it for the submit event it reloads the page with a query string in the browser path.</p>
  
  <p><a href="https://i.stack.imgur.com/xNbzK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xNbzK.png" alt="post data"></a></p>
  
  <p>Now the problem is that the function of the controller is not reached... when i click on the button nothing happens, data is send but it dont reaches laravel controller.</p>