title: Submit form laravel using AJAX
body: <p>I am trying to add comment using AJAX technology but I have an error: 
  <code>Failed to load resource: http://localhost:8888/blog/public/comment/add the server responded with a status of 500 (Internal Server Error)</code>
  Here is my code: 
  View: </p>
  
  <pre><code>{{ Form::open(array('method'=&gt;'post','class'=&gt; 'col-md-6','url' =&gt; '/comment/add', 'id'=&gt;'comment')) }}
                          &lt;input type="hidden" name="post_id" value="{{$id}}"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="inner col-xs-12 col-sm-12 col-md-11 form-group"&gt;
                                  {{Form::label('name', 'Imię')}}
                                  {{Form::text('username', null, array('class'=&gt;'form-control', 'id'=&gt;'name', 'name'=&gt;'name'))}}
                              &lt;/div&gt;
                              &lt;div class="inner col-xs-12 col-sm-12 col-md-12 form-group"&gt;
                                  {{Form::label('message', 'Wiadomość')}}
                                  {{Form::textarea('message', null, array('class'=&gt;'form-control', 'id'=&gt;'message', 'name'=&gt;'message', 'rows'=&gt;'5'))}}
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-xs-12 col-md-12 submit form-group"&gt;
                                  {{Form::submit('Wyślij', array('name'=&gt;'submit', 'class'=&gt;'btn btn-orange'))}}
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                      {{ Form::close() }}
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function addComment()
  {
          $this-&gt;layout = null;
          //check if its our form
          if(Request::ajax()){
              $name = Input::get( 'name' );
              $content = Input::get( 'message' );
  
              $comment = new Comment();
              $comment-&gt;author =  $name;
              $comment-&gt;comment_content = $content;
              $comment-&gt;save();
  
              $postComment = new CommentPost();
              $postComment-&gt;post_id = Input::get('post_id');
              $postComment-&gt;comment_id = Comment::max('id');
              $postComment-&gt;save();
  
              $response = array(
                  'status' =&gt; 'success',
                  'msg' =&gt; 'Setting created successfully',
              );
              return 'yea';
          }else{
              return 'no';
          }
  }
  </code></pre>
  
  <p>AJAX:</p>
  
  <pre><code>    jQuery( document ).ready( function( $ ) {
  
      $( '#comment' ).on( 'submit', function(e) {
          e.preventDefault();
  
          var name = $(this).find('input[name=name]').val();
  
          $.ajax({
              type: "POST",
              url: host+'/comment/add',
          }).done(function( msg ) {
              alert( msg );
          });
  
      });
  });
  </code></pre>
  
  <p>And the last one routes:</p>
  
  <pre><code>Route::post('comment/add', 'CommentController@addComment');
  </code></pre>
  
  <p>Anyone have an idea where is the problem and why I can't submit my form? </p>