admin) { return redirect("/"); } $season = Season::where('id','=',$season_id)->first(); $rounds = Round::where('season_id','=',$season_id)->orderBy('id')->get(); $league = League::where('season_id','=',$season_id)->first(); $start_round_name="Einstellen"; $start_round_id=-1; if ($league) { if ($league->start_round_id) { $startRound = Round::where('id','=',$league->start_round_id)->first(); $start_round_name = $startRound->name; $start_round_id = $startRound->id; } } $startRound=array(); $startRound['id'] = $start_round_id; $startRound['name'] = $start_round_name; // Fetch existing leagues // No leagues: Create Qualification League or Standard League System (including matches) // necessary input: start_round(_id), round_count // Delete all leagues & matches // return view('leagues.index', compact('season','rounds','startRound')); } }