title: Ajax post request in laravel 5 return error 500 (Internal Server Error)
body: <p>This is my test ajax in laravel 5 (refer below)</p>
  <pre><code>$(&quot;#try&quot;).click(function(){
      var url = $(this).attr(&quot;data-link&quot;);
      $.ajax({
          url: &quot;test&quot;,
          type:&quot;POST&quot;,
          data: { testdata : 'testdatacontent' },
          success:function(data){
              alert(data);
          },error:function(){ 
              alert(&quot;error!!!!&quot;);
          }
      }); //end of ajax
  });
  </code></pre>
  <p>and the trigger link</p>
  <pre><code>&lt;a href=&quot;#&quot; id=&quot;try&quot; data-link=&quot;{{ url('/test') }}&quot;&gt;Try&lt;/a&gt;
  </code></pre>
  <p>and my route</p>
  <pre><code>Route::post('test', function()
  {
      return 'Success! ajax in laravel 5';
  });
  </code></pre>
  <p>but it gives me an error when I run the console in google chrome and it doesn't return the expected response &quot;return 'Success! ajax in laravel 5';&quot;</p>
  <blockquote>
  <p>POST <a href="http://juliver.laravel.com/test" rel="nofollow noreferrer">http://juliver.laravel.com/test</a> 500 (Internal Server Error)</p>
  </blockquote>
  <p>whats wrong/problem to my code? anything I'm missing?</p>