Beispiel #1
0
 public function league()
 {
     $baseURL = '../public/';
     $user = Auth::user();
     $allLeague = League::getAllLeague();
     $allLeagueID = League::getAllLeaguebyGroup();
     foreach ($allLeagueID as $league) {
         $lottery = Lottery::getLottriesOfLeague($league->league_id);
         $bowlers = League::getBowlersinLeague($league->league_id);
         $bowlersInLeague[$league->league_id][] = ['league_id' => $league->league_id, 'league_name' => $league->league_name, 'bowlers' => $bowlers, 'lottery' => $lottery];
     }
     return \View::make('league')->with('allLeague', $allLeague)->with('bowlersInLeague', $bowlersInLeague)->with('baseURL', $baseURL);
 }
Beispiel #2
0
 public function getLottriesOfLeague($leagueId)
 {
     $isValidToken = User::checkAuth();
     if ($isValidToken != 0) {
         $allLottries = Lottery::getLottriesOfLeague($leagueId);
         if (empty($allLottries)) {
             return "Invalid Lottery ID or No Lottries in this League";
         }
         return \Response::json($allLottries, 200);
     } else {
         return json_encode("Please enter valid Authentication Token");
     }
 }