/**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $timeslots = TimeSlot::with('djForTimeslot', 'showForTimeslot')->get();
     $shows = WeeklySchedule::mergeFromTimeSlots($timeslots);
     $showSlides = $shows->getShowsForSlideshow();
     $slides = Slides::forShows($showSlides);
     $events = Event::where('type', 'SLIDER')->where('date', '>=', Carbon::today('America/New_York'))->get();
     if (!$events->isEmpty()) {
         $slides->addEvent($events->random());
     }
     $view->with('slides', $slides);
 }
Esempio n. 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function schedule()
 {
     $schedule = WeeklySchedule::mergeFromTimeSlots(TimeSlot::with('djForTimeslot', 'showForTimeslot')->get());
     return view('schedule.schedule')->withSchedule($schedule);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $schedule = WeeklySchedule::fromTimeSlots(TimeSlot::with('djForTimeslot', 'showForTimeslot')->get());
     return view('admin.schedule.index')->withSchedule($schedule);
 }