public function fill(Model $model, Result $result) { $hits = $result->hits()->map(function ($hit) use($model) { return $this->fillModel($model, $hit); }); $result->setHits($hits); }