title: Error 422 Ajax Post using Laravel
body: <p>I'm trying to make a simple Ajax post using Laravel 5. I read that there is a issue with the Csrf Token matching and that i could put my uri into the VerifyCsrfToken expection to step around this. This part functions, however now I get a 422 error when i make the post. </p>
  
  <p><a href="https://i.stack.imgur.com/8gIpr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8gIpr.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/HQ9U0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HQ9U0.png" alt="enter image description here"></a></p>
  
  <p>Did I mess something up in my code? How can I get this working? Here is what I have:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class = "q-form"&gt;
                      {!!Form::open(array('url' =&gt; 'questions')) !!}
                          &lt;div class = "form-group"&gt;
                              {!! Form::hidden('user_id', $myid, ['class' =&gt; 'form-control']) !!}
                              {!!Form::label('title', 'Title:')!!}
                              {!!Form::text('title', null, ['class'=&gt; 'form-control'])!!}
  
                              {!!Form::label('question', 'Question:')!!}
                              {!!Form::textarea('question', null, ['class'=&gt; 'form-control area', 'placeholder' =&gt; 'What would you like to ask?'])!!}
  
  
                          {!!Form::submit('Ask!', ['class'=&gt; 'btn btn-danger form-control ask'])!!}
                          &lt;/div&gt;
                      {!! Form::close() !!}
                  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>$('.ask').click(function(e) {
  
         e.preventDefault();
  
         var postData = $(this).serializeArray();
  
         var base_url = 'http://rem-edu-es.eu1.frbit.net/';
         $.ajax({
             type: "POST",
             url: base_url + "questions",
             data: postData,
             success: function (data) {
                 console.log(data);
             }
  
         });
     });
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code> public function book()
  {
  
      if(Request::ajax()){
  
          return Response::json(Input::all());
  
      }
  }
  </code></pre>
  
  <p><strong>VerifyCsrfToken:</strong></p>
  
  <pre><code>  class VerifyCsrfToken extends BaseVerifier
  {
  
      protected $except = [
          'book/*',
          'book',
           'questions'
  
      ];
  }
  </code></pre>