コード例 #1
0
ファイル: Slides.php プロジェクト: woolensculpture/pulse
 public static function forShows($shows)
 {
     $slides = new Slides();
     foreach ($shows as $key => $show) {
         $slide = Slide::fromScheduledShow($show);
         $slide->playOrder($key);
         $slide->index($key);
         $slides->push($slide);
     }
     return $slides;
 }
コード例 #2
0
 /**
  * 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);
 }