| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 20 | public function compose(View $view) |
||
| 21 | { |
||
| 22 | $timeslots = TimeSlot::with('djForTimeslot', 'showForTimeslot')->get(); |
||
| 23 | $shows = WeeklySchedule::mergeFromTimeSlots($timeslots); |
||
| 24 | $showSlides = $shows->getShowsForSlideshow(); |
||
| 25 | |||
| 26 | $slides = Slides::forShows($showSlides); |
||
| 27 | |||
| 28 | $events = Event::where('type', 'SLIDER') |
||
| 29 | ->where('date', '>=', Carbon::today('America/New_York')) |
||
| 30 | ->get(); |
||
| 31 | |||
| 32 | if (!$events->isEmpty()) |
||
| 33 | { |
||
| 34 | $slides->addEvent($events->random()); |
||
| 35 | } |
||
| 36 | |||
| 37 | $view->with('slides', $slides); |
||
| 38 | } |
||
| 39 | } |