title: AJAX post not sending data to controller
body: <p>Maybe this is a very common topic, but i can't find any solution!, I try to make ajax post to a controller when i try to console.log, the data is there but data is not sent to my controller, this is screenshot my console.log, I need to send some data from jquery ajax to a laravel controller, so that i have a meta with the csrf token, when i send the post request to an URL using ajax, it just sends the token!! but nothing of the data i give it to send.</p>
  
  <p><a href="https://i.stack.imgur.com/BR1LV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BR1LV.png" alt="console log"></a> </p>
  
  <p><strong>This is my javaScript code:-</strong></p>
  
  <pre><code>function doComment(lesson_id, parent_id) {
      var body = $('#textbody'+parent_id).val();
      var file_data = $('#image').prop("files")[0]; 
      if (body == '') {
        alert('Harap Isi Komentar !')
      }else {
        var postData =
                    {
                        "_token":$('meta[name="csrf-token"]').attr('content'),
                        "lesson_id": lesson_id,
                        "parent_id": parent_id,
                        "image" : image,
                        "body": body
                    }
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $.ajax({
            type    :'POST',
            url     :'{{ url("lessons/coments/doComment") }}',
            dataType: 'json',
            cache: false,
            contentType: false,
            processData: false,
            data    : postData,
            beforeSend: function(){
              console.log(postData);
              // Show image container
              swal({
                  title: "Sedang mengirim Komentar",
                  text: "Mohon Tunggu sebentar",
                  imageUrl: "{{ asset('template/web/img/loading.gif') }}",
                  showConfirmButton: false,
                  allowOutsideClick: false
                });
                {{--  $("#loader").show();  --}}
            },
            success:function(data){
              if (data.success == false) {
                 window.location.href = '{{ url("member/signin") }}';
              }else if (data.success == true) {
                $('#textbody'+parent_id).val('');
                swal({
                  title: "Komentar anda sudah terkirim!",
                  showConfirmButton: true,
                  timer: 3000
                });
  
                getComments();
              }
            }
        });
      }
    }
  </code></pre>
  
  <p>and this is my controller </p>
  
  <pre><code>public function doComment()
      {
          $response = array();
          if (empty(Auth::guard('members')-&gt;user()-&gt;id)) {
              $response['success'] = false;
          } else {
  
              $now = new DateTime();
              $uid = Auth::guard('members')-&gt;user()-&gt;id;
              $body = Input::get('body');
              $lesson_id = Input::get('lesson_id');
              $member = DB::table('members')-&gt;where('id', $uid)-&gt;first();
              $lessons = DB::table('lessons')-&gt;where('id', $lesson_id)-&gt;first();
              $parent_id = Input::get('parent_id');
              $contri = Lesson::where('id',$lesson_id)
                        -&gt;select('contributor_id')
                        -&gt;first();
              // dd($lesson_id);
              $image = Input::file('image');
              // dd($image);
  
              $lessonsDestinationPath= 'assets/source/komentar';
  
              if(!empty($image)){
                  $imagename    = $image-&gt;getClientOriginalExtension();
                  $image-&gt;move($lessonsDestinationPath, $imagename);
              }else{
                  $imagename    = '';
              }
              if($imagename ==''){
                  $url_image= $imagename;
              }else{
                  $urls=url('');
                  $url_image= $urls.'/assets/source/komentar/'.$imagename;
              }
  
              $store = DB::table('comments')-&gt;insertGetId([
                  'lesson_id' =&gt; $lesson_id,
                  'member_id' =&gt; $uid,
                  'body' =&gt; $body,
                  'parent_id' =&gt; $parent_id,
                  'status' =&gt; 0,
                  'desc'   =&gt; 0,
                  'images' =&gt; $url_image,
                  'contributor_id' =&gt; str_replace('}','',str_replace('{"contributor_id":', '',$contri)),
                  'created_at' =&gt; $now,
                  'updated_at' =&gt; $now,
              ]);
  
              $getmembercomment = DB::table('comments')
              -&gt;Join('members','members.id','=','comments.member_id')
              -&gt;where('comments.lesson_id',$lesson_id)
              -&gt;where('comments.parent_id',0)
              -&gt;where('comments.status',1)
              -&gt;select('comments.*','members.username as username')
              -&gt;first();
  
              $getemailchild = DB::table('comments')
                               -&gt;Join('comments as B', 'comments.id', 'B.parent_id')
                               -&gt;Where('B.parent_id', $parent_id)
                               -&gt;where('comments.member_id', '&lt;&gt;', 'B.member_id')
                               -&gt;select('comments.member_id as tanya', 'B.member_id as jawab')-&gt;distinct()
                               -&gt;get();
  
  
              // dd($getemailchild);
              if($parent_id != 0){
                  foreach ($getemailchild as $mails) {
                  //  Check type
                  if (is_array($mails)){
                      //  Scan through inner loop
                      foreach ($mails as $value) {
                          $member = Member::Find($value);
                          $lesson = Lesson::Find($lesson_id);
                          $contrib = Contributor::find($lessons-&gt;contributor_id);
                          $member-&gt;notify(new UserReplyNotification($member, $lesson, $contrib));
                      }
                  }
              }
  
              }
              if ($store) {
  
                  // dd($store);
                      DB::table('contributor_notif')-&gt;insert([
                          'contributor_id' =&gt; $lessons-&gt;contributor_id,
                          'category' =&gt; 'Komentar',
                          'title' =&gt; 'Anda mendapat pertanyaan dari ' . $member-&gt;username,
                          'notif' =&gt; 'Anda mendapatkan pertanyaan dari ' . $member-&gt;username . ' pada ' . $lessons-&gt;title,
                          'status' =&gt; 0,
                          'created_at' =&gt; $now,
                      ]);
                      $member = Member::Find($uid);
                      $comment = Comment::Find($store);
                      $lesson = Lesson::find($lessons-&gt;id);
                      $contrib = Contributor::find($lessons-&gt;contributor_id);
                      $contrib-&gt;notify(new UserCommentNotification($member, $comment, $contrib, $lesson));
  
  
                      $response['success'] = true;
              }
          }
          echo json_encode($response);
      }
  </code></pre>
  
  <p>this is my route :</p>
  
  <pre><code>Route::post('lessons/coments/doComment','Web\LessonsController@doComment');
  </code></pre>
  
  <p><strong>This is my error:-</strong>
  <a href="https://i.stack.imgur.com/r9moa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r9moa.png" alt="error when send data"></a></p>