with('away')->where('id', (int) $match_id)->first(); if (! $match) { return []; } $expectations = []; ExpectationsTeam::load($expectations, $filter, $match); if ($team_id == $match->home_id) { $expectations['active_team'] = $match->home->ss_team_name; } else { $expectations['active_team'] = $match->away->ss_team_name; } /** * LEAGUE AVERAGES */ if ($team_id != 0 && $similar_past_matches == 'none') { AverageTeam::load($expectations, $filter); AverageTeamSeason::load($expectations, $filter, $match); AverageLeagueSeason::load($expectations, $filter); } return $expectations; } }