title: how to retrieve the common words in rows in laravel 5.2
body: <p>I am getting stuck on this.  I have two checkboxes i.e. Manicure and pedicure
  When user select manicure ajax runs and then i want to find the manicure word from all rows Like that:-</p>
  
  <pre><code>enter code here
  id   name
   1    Get Manicure
   2    Manicure &amp; Pedicure
   3    Repair Manicure
   4    Get Pedicure
   5    Dummy text
  </code></pre>
  
  <p>Now suppose i have five records in my table
  when user clicks on <strong>Manicure</strong> checkbox i want it must returns the 1,2,3 id
  and when user click on Both manicure and pedicure i want 1,2,3,4 record
  and when user clicks on pedicure only 2,4 id must return 
  Can anyone help me how to acheive this functionality.Here is my code</p>
  
  <pre><code>enter code here
  $query = Service::whereIn('name',array('Pedicure'))-&gt;get();// Only pedicure
  $query = Service::whereIn('name',array('Manicure'))-&gt;get(); // Only manicure
  $query = Service::whereIn('name',array('Manicure','pedicure'))-&gt;get(); //Both
  </code></pre>
  
  <p>I think it might be work with where condition with forloop in between</p>