I'm using Laravel scout with Algolia search.
I have this eloquent relation:
public function doctors()
{
return $this->belongsTo(Doctor::class, 'doctor_id');
}
Here I get results by Algolia search:
$doctors = DoctorInfo::search($this->search)
->with([
'typoTolerance' => true,
])
->paginate(10);
I get a lot of single queries:
select * from `doctors` where `doctors`.`id` = 131 limit 1
select * from `doctors` where `doctors`.`id` = 141 limit 1
select * from `doctors` where `doctors`.`id` = 191 limit 1
....
How can I get an eloquent relation using "whereIn" instead "where"?
thanks to all!