public function getAllLeague() { $isValidToken = User::checkAuth(); if ($isValidToken != 0) { $allLeagues = League::getAllLeague(); return \Response::json($allLeagues, 200); } else { return json_encode("Please enter valid Authentication Token"); } }
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); }
public function getAllLeague() { $allLeagues = League::getAllLeague(); return \Response::json($allLeagues, 200); }