@php // $hasPaid = $course->courseInvoice->contains('payment_status', 'paid'); $hasPaid = false; // if ($course && $course->courseInvoice) { // $hasPaid = $course->courseInvoice->contains('payment_status', 'paid'); // } if ($course && $course->students) { foreach ($course->students as $student) { if ($student->finanaceStudentInvoice && $student->finanaceStudentInvoice->payment_status === 'paid') { $hasPaid = true; break; } } } @endphp @if ($hasPaid) {{-- @dd($course) --}} @if ($course->schedule_type == 'track') {{-- Student --}} @include('dashboard.teacher.course.student_modal', ['course' => $course]) @else {{-- Student --}}
@csrf @if ($course->schedule_type == 'track') @endif @php $student = $course->students->first(); @endphp @if ($student) @endif
@endif @else @endif