title: Send data to Laravel controller using ajax
body: <p>I'm trying to send POST request to a Laravel controller using ajax, BUT nothin happen </p>
  
  <h3>Script</h3>
  
  <pre><code>&lt;script&gt;
  (function($) {
      jQuery('#categorie,#marque').change(function () {
          var id_marq=$('#marque').val();
          var id_cat=$('#categorie').val();
          var url = $('#application_url').val();
          $.ajaxSetup({
              headers: {
                  'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
              }
          });
          $.ajax({
              url: url+"/produits/ajoutPrixProduit",
              type:"POST",
              data:{'id_cat':id_cat, 'id_marq':id_marq},
              dataType: "json",
              success: function (response) {
                  $.each(response, function (key, value) {
                      $('#nom').append('&lt;option value="' + key.id + '"&gt;' + value.libelle + '&lt;/option&gt;');
                  });
              }
          });
      })(jQuery);
  });
  </code></pre>
  
  <p></p>
  
  <h3>Route</h3>
  
  <pre><code>Route::post('/produits/ajoutPrixProduit', 'MagasinBoardController@selProduit')-&gt;name('magasin.selProduit');
  </code></pre>
  
  <h3>Controller</h3>
  
  <pre><code>public function selProduit(Request $request)
  {
      $id_cat=$request-&gt;id_cat;
      $id_marq=$request-&gt;id_marq;
     .......
      return response()-&gt;json($listProd); 
  }
  </code></pre>
  
  <p>I don't know why and how to fix it</p>