Example #1
0
 /**
  * @param $slug
  * @return mixed
  */
 public function view($slug)
 {
     // Get the selected event
     $event = $this->event->live()->where($this->event->getTable() . '.slug', '=', $slug)->firstOrFail();
     // Get the next newest and next oldest event if the config says to show these links on the view page
     $newer = $older = false;
     if (\Config::get('laravel-events::views.view_page.show_adjacent_items')) {
         $newer = $event->newer();
         $older = $event->older();
     }
     // Get the archives data if the config says to show the archives on the view page
     if (\Config::get('laravel-events::views.view_page.show_archives')) {
         $archives = $this->event->archives();
     }
     return \View::make(\Config::get('laravel-events::views.view_page.view'), compact('event', 'newer', 'older', 'archives'));
 }