コード例 #1
0
 /**
  * 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'));
 }
コード例 #2
0
 /**
  * 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'));
 }
コード例 #3
0
 public function getComplete()
 {
     $clubs = \App\Club::lists('name', 'id')->toArray();
     $clubs = array_merge([0 => '-- Favorite club --'], $clubs);
     return view('pages.complete', compact('clubs'));
 }