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(Game $game) { $team = Team::find(config('mls.team_id')); $playerList = Player::where('team_id', $team->id)->get(); $visitMap = ['' => ''] + Stat::$visitList; $visitList = StatRepository::getActiveVisitsForGame($game->id); $visitList = $visitList->lists(Stat::VISIT, 'player_id'); return view('backend.visits.edit')->with('playerList', $playerList)->with('visitList', $visitList)->with('visitMap', $visitMap)->with('game', $game); }
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); }
public static function saveQuickVisit(Request $request) { if (!Game::find($request->get('game_id'))) { return; } self::removeVisits($request->get('game_id')); foreach ($request->all() as $key => $input) { if (strpos($key, 'player_') !== false && $input > 0) { $id = str_replace('player_', '', $key); if (Player::find($id)) { StatRepository::addVisit($request->get('game_id'), $id, $input); } } } }
public function view(Player $player) { $stats = StatRepository::getByPlayerId($player->id); return view('frontend.players.view')->with('player', $player)->with('stats', $stats); }