title: How to clear auto complete results when input field is empty in Laravel + Vue Js?
body: <p>Please am working on autoComplete Search bar and wants to clear the search if input field is empty. Currently, am able to display results but I still see the search result in my div when I clear the field. I want the div to go empty when i clear search input. Any assistance please</p>
  <p>Vue code below</p>
  <pre><code>&lt;template&gt;
      &lt;div style=&quot;margin-top:8px&quot;&gt;
          &lt;input type=&quot;text&quot; v-model=&quot;form.user&quot; v-on:keyup=&quot;show&quot; class=&quot;form-control&quot;&gt;
          &lt;div class=&quot;panel-footer&quot; v-if=&quot;results.length&quot;&gt;
              &lt;ul v-for=&quot;result in results&quot; :key=&quot;result.id&quot;&gt;
                  &lt;li&gt;{{result.name}}&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
  export default {
  
      data(){
          return{
              form:{
                  user: &quot;&quot;
              },
              results: []
  
          }
      },
  
      methods:{
          show(){
              axios.post('/users', this.form).then((res)=&gt;{
                  this.results = res.data
              })
          }
  
      }
      
  }
  &lt;/script&gt;
  
  </code></pre>
  <p><em><strong>Controller</strong></em></p>
  <pre><code>public function getUser(Request $request){
          $qry = $request-&gt;input('user');
          $all_user = DB::table('users')
          -&gt;where(&quot;name&quot;, &quot;like&quot;, &quot;%&quot; . $qry . '%')
          -&gt;get();
          return $all_user;
      }
  </code></pre>