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 edit(Training $training)
 {
     $team = Team::find(config('mls.team_id'));
     $playerList = PlayerRepository::getListByTeamId($team->id);
     $dayList = Training::getDayOfWeekList();
     $visitList = TrainingVisitRepository::getTrainingVisits($training->id);
     $visitList = $visitList->lists('visit', 'player_id');
     return view('frontend.trainings.edit')->with('training', $training)->with('team', $team)->with('playerList', $playerList)->with('dayList', $dayList)->with('visitList', $visitList)->with('statusVisited', Stat::GAME_VISITED)->with('statusNotVisited', Stat::GAME_NOT_VISITED);
 }
 public function index(Request $request)
 {
     $team = Team::find(config('mls.team_id'));
     $playerList = PlayerRepository::getListByTeamId($team->id);
     $tournamentList = TournamentRepository::getListByTeamId($team->id);
     $selectedPlayerList = $request->get('playerList');
     $selectedTournamentList = $request->get('tournamentList');
     $filterPlayerList = $selectedPlayerList ? $selectedPlayerList : $playerList->lists('id')->all();
     $statList = StatRepository::getFilteredPlayersStatistics($filterPlayerList, $selectedTournamentList);
     return view('frontend.stats.view')->with('team', $team)->with('playerList', $playerList)->with('statList', $statList)->with('tournamentList', $tournamentList->lists('name', 'id'))->with('selectedPlayerList', $selectedPlayerList)->with('selectedTournamentList', $selectedTournamentList);
 }
 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);
 }