/** * @param \Illuminate\Http\Request $request * @param \App\Services\MatchService $service * @param $summoner * * @return \Ekko\Collection\MatchCollection */ public function matchHistory(Request $request, MatchService $service, $summoner) { $matches = $service->getMatches($summoner, (int) $request->get('limit', 10)); $matches->each(function (Match $match) use($summoner) { $match->participants->remove(['stats', 'timeline', 'masteries', 'runes'], [$summoner]); }); return $matches; }