diff --git a/app/Http/Controllers/SoccerAPI/SoccerAPIController.php b/app/Http/Controllers/SoccerAPI/SoccerAPIController.php index cad34ed2..ab9715b0 100644 --- a/app/Http/Controllers/SoccerAPI/SoccerAPIController.php +++ b/app/Http/Controllers/SoccerAPI/SoccerAPIController.php @@ -87,6 +87,15 @@ function leaguesDetails($leagueId, Request $request) if($league->coverage->topscorer_goals && !in_array($leagueId, $excludedLeagues)) { $topscorers = $soccerAPI->topscorers()->setInclude($includeTopscorers)->bySeasonId($league->current_season_id)->goalscorers->data; + + foreach($topscorers as $key => $topscorer) { + if($topscorer->stage_id != $league->current_stage_id) { + unset($topscorers[$key]); + } + } + + $topscorers = self::addPagination($topscorers, 10); + } $lastFixtures = [];