/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $gameweek = Gameweek::findOrFail($id); $gameweek->overFixtures = $gameweek->fixtures()->over()->get(); $gameweek->pendingFixtures = $gameweek->fixtures()->get()->filter(function ($fxt) { return $fxt->isClosed() and !$fxt->isOver(); }); $gameweek->upcomingFixtures = $gameweek->fixtures()->get()->filter(function ($fxt) { return !$fxt->isClosed(); }); $gameweek->fxtCnt = $gameweek->overFixtures->count() + $gameweek->pendingFixtures->count() + $gameweek->upcomingFixtures->count(); $clubs = Club::lists('name', 'id')->toArray(); return view('admin.gameweek.show', compact('gameweek', 'clubs')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $fixture = Fixture::findOrFail($id); $clubs = Club::lists('name', 'id')->toArray(); return view('admin.fixture.edit', compact('fixture', 'clubs')); }
public function getComplete() { $clubs = \App\Club::lists('name', 'id')->toArray(); $clubs = array_merge([0 => '-- Favorite club --'], $clubs); return view('pages.complete', compact('clubs')); }