public function render($parameters = array())
 {
     $match = Match::orderBy('played_at', 'DESC')->where('state', '!=', Match::STATE_HIDDEN)->first();
     if ($match) {
         return View::make('matches::featured_widget', compact('match'))->render();
     }
 }
Example #2
0
 public function render($parameters = array())
 {
     $matches = Match::orderBy('played_at', 'DESC')->whereState(Match::STATE_CLOSED)->take(5)->get();
     if ($matches) {
         return View::make('matches::widget', compact('matches'))->render();
     }
 }
Example #3
0
 public function render($parameters = array())
 {
     $limit = isset($parameters['limit']) ? (int) $parameters['limit'] : self::LIMIT;
     $matches = Match::orderBy('played_at', 'DESC')->whereState(Match::STATE_CLOSED)->take($limit)->get();
     if ($matches) {
         return View::make('matches::widget', compact('matches'))->render();
     }
 }
Example #4
0
 /**
  * Show a match
  * 
  * @param  int $id The id of the match
  * @return void
  */
 public function show($id)
 {
     $match = Match::findOrFail($id);
     $match->access_counter++;
     $match->save();
     $this->title($match->leftTeam->title . ' ' . trans('matches::vs') . ' ' . $match->rightTeam->title);
     $this->pageView('matches::show', compact('match'));
 }