title: Post request with jQuery and Laravel framework
body: <p>I need to receive data from jQuery post request, think there is some error with routs or controller, here is my post request javascript code:</p>
  
  <pre><code>$.post('http://localhost:8000/ajax',
                  {
  
                      task: "comment_insert",
                      userID: _userID,
                      comment: _comment,
                      name: _name,
                      userName: _userName
                  }
  
                  ).error(
                      function(data)
                      {
                        alert("Error: "+ data); 
                      }
                   )
                  .success(
                      function( data )
                      {
                          comment_insert(jQuery.parseJSON( data ));
                        console.log("RESPOND TEXT:" + data);
  
                      }
                   );
  
       }
  </code></pre>
  
  <p>Also here is my routes for Laravel framework:</p>
  
  <pre><code>Route::post('ajax', 'AjaxController@index');
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>class AjaxController extends Controller {
  
      /**
       * Display a listing of the resource.
       *
       * @return Response
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      public function index()
      {
               return view('ajax.ajax');
  
      }
  }
  </code></pre>
  
  <p>my ajax.php script is into /resource/views/ajax/ajax.php
  Also if I put script into /public/ajax/ajax.php all works fine....I use Laravel 5... Please help</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I found what is problem but don't know how to solve.</p>
  
  <p>When I disable csrf protection from: kernel.php code work anyone know how to make code work with csrf protection enabled?</p>