title: trying to filter brand names but its not working
body: <p>I am trying to filter brands using search bar but I don't know the ajax code to filter</p>
  
  <p>Controller</p>
  
  <pre><code>$brands = (request()-&gt;session()-&gt;get('business.enable_brand') == 1) ? Brands::where('business_id', $business_id)
                      -&gt;pluck('name', 'id')
                       -&gt;prepend(__('lang_v1.all_brands'), 'all') : false;
  </code></pre>
  
  <p>ajax</p>
  
  <pre><code>$(function () {
  
      var minlength = 3;
  
      $("#searchbrands").keyup(function () {
          var that = this,
          value = $(this).val();
  
           if (value.length &gt;= minlength ) {
              if (searchRequest != null) 
                  searchRequest.abort();
              searchRequest = $.ajax({
  
              });
          }
       });
   });
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;input type="search" id="searchbrands"  name="" class="form-control" placeholder="Type brand here. . . "&gt;
  
              @if(!empty($brands))
  
                  @foreach($brands as $id =&gt; $brand)
                  &lt;a class="fontsizs text-uppercase" id="product_brand" onclick="brandfilter({{ $id }});" href="javascript:void(0)" &gt;{{$brand}}&lt;/a&gt;
  
                  @endforeach
              @endif
  </code></pre>