#### Category : multiple-select

I have job_sector table in which sector_id and job_id fields are there. I just want to search job_id by the sectors which I have selected through checkbox. One may select multiple sectors. My model : public function scopeSelectedOptions($query,$input = []) { if(!empty($input)) { if(array_key_exists(‘sector_id’,$input)) { $query->whereHas(‘sector_id’, function($q) use ($input) { return$q->whereIn(‘sector_id’, \$input[‘sector_id’]); ..