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:-
enter code here
id name
1 Get Manicure
2 Manicure & Pedicure
3 Repair Manicure
4 Get Pedicure
5 Dummy text
Now suppose i have five records in my table when user clicks on Manicure 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
enter code here
$query = Service::whereIn('name',array('Pedicure'))->get();// Only pedicure
$query = Service::whereIn('name',array('Manicure'))->get(); // Only manicure
$query = Service::whereIn('name',array('Manicure','pedicure'))->get(); //Both
I think it might be work with where condition with forloop in between