public function index()
 {
     $stats = Stat::all();
     $teamMap = Game::all()->lists('team', 'id');
     $playerMap = Player::all()->lists('name', 'id');
     return view('backend.stats.list')->with('stats', $stats)->with('parameterList', Stat::getParameterList())->with('teamMap', $teamMap)->with('playerMap', $playerMap);
 }
 public function postEditTeam(LoggedInRequest $request, $teamID)
 {
     // $teamKey = $request->input('teamKey');
     $team = Team::findOrFail($teamID);
     $team->name = $request->input('teamName');
     $team->abb = strtoupper($request->input('teamAbb'));
     if ($request->input('delete') == "delete") {
         $games = Game::all();
         foreach ($games as $game) {
             if ($game->winner == $team->team_key || $game->loser == $team->team_key) {
                 $game->delete();
             }
         }
         $team->delete();
         $request->session()->flash('msg', 'Team ' . $team->name . ' deleted!');
     } else {
         if ($request->input('reset') == "reset") {
             $team->games = 0;
             $team->wins = 0;
             $request->session()->flash('msg', 'Team ' . $team->name . ' reset!');
             $team->save();
         } else {
             $request->session()->flash('msg', 'Team ' . $team->name . ' updated!');
             $team->save();
         }
     }
     return $this->getEditTeam($request);
 }
 public function clearAll()
 {
     $users = User::all();
     foreach ($users as $u) {
         $u->delete();
     }
     $drills = Drill::all();
     foreach ($drills as $d) {
         $d->delete();
     }
     $games = Game::all();
     foreach ($games as $g) {
         $g->delete();
     }
     $clubs = Club::all();
     foreach ($clubs as $c) {
         $c->delete();
     }
 }
 public function all()
 {
     return Game::all();
 }
 public function lobby()
 {
     $games = Game::all();
     return view('lobby.index', compact('games'));
 }
 public function index()
 {
     $games = Game::all();
     return view('backend.games.list')->with('games', $games)->with('homeList', Game::getHomeList())->with('statusList', Game::getStatusList());
 }
 public function index()
 {
     $gameList = Game::all();
     return view('backend.visits.list')->with('gameList', $gameList);
 }