title: Laravel 5 randomly send 500 Internal Server Error on ajax requests
body: <p>In my application Laravel 5 randomly send 500 Internal Server Error on ajax requests (for example, on ten 200 OK requests, one 500 Internal Server Error request). CSRF token is correctly set up:</p>
  
  <pre><code>$(function() {
  
      $.ajaxSetup({
  
          timeout: 3000,
          headers: {
  
              'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
          }
      });
  });
  </code></pre>
  
  <p>This is what Laravel says</p>
  
  <p><a href="https://i.stack.imgur.com/8huro.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/8huro.jpg" alt="enter image description here"></a></p>
  
  <p>How can I fix this or catch the place in code where problem located?</p>