title: Jquery ui slider with ajax in laravel
body: <p>I am trying to use jquery ui (range) slider with ajax, to filter products according to price range from user. Jquery ui slider, routes and controller are arranged correctly but ajax is not connecting them. Below are my codes:</p>
  
  <p>Slider html code:</p>
  
  <pre><code>&lt;h4&gt;Filter by:&lt;/h4&gt;
  &lt;p&gt;
    &lt;label for="amount"&gt;Price:&lt;/label&gt;
    &lt;input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;"&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Html code were i want change with ajax:</p>
  
  <pre><code>@foreach( $proucts as $product)
   &lt;div class="col-md-4 col-sm-4"&gt;
     &lt;img src="{{$product-&gt;image}}"&gt;
     &lt;p&gt;{{$product-&gt;name}}-{{$product-&gt;price}}&lt;/p&gt;
   &lt;/div&gt;
  @endforeach
  </code></pre>
  
  <p>Jquery slider function with ajax</p>
  
  <pre><code>$( function() {
    $( "#price-range" ).slider({
      range: true,
      min: 0,
      max: 3500,
      values: [ 75, 1500 ],
      slide: function( event, ui ) {
        $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
        var value1 = ui.values[0];
        var value2 = ui.values[1];
  
        $.ajax({
          type: "GET",
          url: "price.filter",
          data: "value1="+value1+"&amp;value2="+value2,
          cache: false,
          success: function(html){
            $('public.products.list');
          }
        });
      }
    });
    $( "#amount" ).val( "$" + $( "#price-range" ).slider( "values", 0 ) +
    " - $" + $( "#price-range" ).slider( "values", 1 ) );
  });
  </code></pre>
  
  <p>My route:</p>
  
  <pre><code>Route::get('filterprice/{min}/{max}', 
            ['as' =&gt; 'price.filter',
            'uses' =&gt; 'PublicController@filterPrice']);
  </code></pre>
  
  <p>My method in controller:</p>
  
  <pre><code>public function filterPrice($min, $max)
  {
      $filter = DB::table('products')
                  -&gt;whereBetween('price', 
                   [use($min), use($max)])
                  -&gt;get();
  
       return view('public.products.list')-&gt;withTours($filter);
  }
  </code></pre>
  
  <p>I would be very thank full if anyone could share idea about this.</p>