public function index() { $team = Team::find(config('mls.team_id')); $playerList = PlayerRepository::getActiveListByTeamId($team->id); $gameList = GameRepository::getListByTeamId($team->id); $trainingList = TrainingRepository::getActiveList($team->id); $statList = StatRepository::getPlayersStatistics($playerList); return view('frontend.teams.view')->with('team', $team)->with('playerList', $playerList)->with('gameList', $gameList)->with('trainingList', $trainingList)->with('statList', $statList); }
public function showVisit(Game $game) { $team = Team::find(config('mls.team_id')); $playerList = PlayerRepository::getActiveListByTeamId($team->id); if (!isset($game->id)) { $game = GameRepository::getNextGameByTeamId($team->id); } if (!$game) { return view('frontend.game.no_game'); } $gameSiblings = GameRepository::getSiblings($game); $visitList = StatRepository::getVisitsForGame($game->id); $visitList = $visitList->lists(Stat::VISIT, 'player_id'); return view('frontend.game.index')->with('team', $team)->with('playerList', $playerList)->with('game', $game)->with('visitList', $visitList)->with('gameSiblings', $gameSiblings)->with('statusVisited', Stat::GAME_VISITED)->with('statusNotVisited', Stat::GAME_NOT_VISITED); }