title: How to change status with ajax in laravel
body: <p>I'm using laravel project and I have a shopping cart.</p>
  
  <p>I want to send number of the product to method name quantity with ajax and give it as a request but it gives me this error</p>
  
  <blockquote>
    <p>The GET method is not supported for this route. Supported methods: POST.</p>
  </blockquote>
  
  <p>here is my route</p>
  
  <pre><code>Route::post('/user-cart/{shop}/{userID}/quantity-change/{id}', 'CartController@quantity')-&gt;middleware('auth')-&gt;name('quantity');
  </code></pre>
  
  <p><strong>My controller:</strong></p>
  
  <pre><code>public function quantity(Request $request){
  
      dd($request-&gt;all());
  }
  </code></pre>
  
  <p>this is my numbers option</p>
  
  <pre><code>&lt;td&gt;
  
      &lt;select class="c-ui-select js-ui-select" id="expressShipping-count-0" autocomplete="off" tabindex="-1"&gt;
          &lt;a href="#"&gt;&lt;option value="1"&gt;۱&lt;/option&gt;&lt;/a&gt;
          &lt;option value="2"&gt;۲&lt;/option&gt;
          &lt;option value="3"&gt;۳&lt;/option&gt;
          &lt;option value="4" selected=""&gt;۴&lt;/option&gt;
          &lt;option value="5"&gt;۵&lt;/option&gt;
      &lt;/select&gt;
  
  &lt;/td&gt;
  </code></pre>
  
  <p>here is my ajax</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function(){
   $('#expressShipping-count-0').on('change', function(){
       var value = $(this).val();
       console.log(value);
           $.ajax({
             type:'post',
               url: "{{url('/user-cart/digikala/7/quantity-change/1')}}",
               data: {
                   value: value,
                   "_token": $('#csrf-token')[0].content //pass the CSRF_TOKEN()
               },
               success: function(data) {
                   var url = document.location.origin + "/user-cart/{shop}/{userID}/quantity-change/{id}";
                   location.href = url;
               }
           });
      });
  });</code></pre>
  </div>
  </div>
  </p>