load(['student.doublers', 'student.school']); // Get unscored entries sorted by draw number $unscored_entries = $audition->entries() ->whereDoesntHave('totalScore') ->whereDoesntHave('flags', function ($query) { $query->where('flag_name', 'no_show'); }) ->whereDoesntHave('flags', function ($query) { $query->where('flag_name', 'failed_prelim'); }) ->with('student.school') ->orderBy('draw_number', 'asc') ->get(); // Get no show entries sorted by draw number $noshow_entries = $audition->entries() ->whereDoesntHave('totalScore') ->whereHas('flags', function ($query) { $query->where('flag_name', 'no_show'); }) ->with('student.school') ->orderBy('draw_number', 'asc') ->get(); // Get failed prelim entries sorted by draw number $failed_prelim_entries = $audition->entries() ->whereDoesntHave('totalScore') ->whereHas('flags', function ($query) { $query->where('flag_name', 'failed_prelim'); }) ->with('student.school') ->orderBy('draw_number', 'asc') ->get(); // Get Doublers $doublerData = Doubler::where('event_id', $audition->event_id) ->whereIn('student_id', $scored_entries->pluck('student_id')) ->get() ->keyBy('student_id'); return view('tabulation.auditionSeating', compact('audition', 'scored_entries', 'unscored_entries', 'noshow_entries', 'failed_prelim_entries', 'doublerData') ); } public function declineSeat(Audition $audition, Entry $entry) { $entry->addFlag('declined'); return redirect()->route('seating.audition', ['audition' => $audition->id])->with('success', $entry->student->full_name().' has declined '.$audition->name); } protected function pickRightPanel(Audition $audition, array $seatable) { if ($audition->hasFlag('seats_published')) { $resultsWindow = new GetAuditionSeats; $rightPanel['view'] = 'tabulation.auditionSeating-show-published-seats'; $rightPanel['data'] = $resultsWindow($audition); return $rightPanel; } if ($seatable['allScored'] == false || $seatable['doublersResolved'] == false) { $rightPanel['view'] = 'tabulation.auditionSeating-unable-to-seat-card'; $rightPanel['data'] = $seatable; return $rightPanel; } $rightPanel['view'] = 'tabulation.auditionSeating-right-complete-not-published'; $rightPanel['data'] = $this->auditionService->getSeatingLimits($audition); return $rightPanel; } }