@php $type = isset($type) ? $type : 'ongoing'; $messages = [ 'ongoing' => "수강중인 강의가 없습니다.", "finished" => "종료된 강의가 없습니다." ]; @endphp @if ( $enrollments->isNotEmpty() )
@foreach ( $enrollments as $enrollment ) @php $startedAt = Carbon::parse($enrollment->started_at)->format('Y.m.d'); $endedAt = Carbon::parse($enrollment->ended_at)->format('Y.m.d'); $remainingDays = Carbon::now()->diffInDays(Carbon::parse($enrollment->ended_at), false); @endphp
{{ $enrollment->id }}
{{ ucfirst($enrollment->module) }} @if ( $type == 'ongoing') @if ($enrollment->product->is_extensible) 무료연장 @endif 진도율 {{ round($enrollment->progress_rate) ?? 0 }}% @else @if($enrollment->status == 'PAUSED') 휴강중 @endif @endif
{{ $enrollment->product->name }}
{{ $enrollment->productOption?->name }}
수강기간
{{ $startedAt }} ~ {{ $endedAt }}   ({{ $remainingDays > 0 ? $remainingDays . "일 남음" : "종료됨" }})
@if ( $type == 'ongoing')
@if ($enrollment->product->is_pausable) @php $pausable = $enrollment->is_pause; @endphp @if ( $pausable['status'] ) 휴강신청 @else @if ( ! empty($pausable['message']) ) 휴강신청 @endif @endif @endif @if ($enrollment->is_refundable) 출석확인 @endif 수강후기 작성
@if ($enrollment->status == 'READY') 강의실 입장 @else 강의실 입장 @endif
@else
@if ($enrollment->ended_at > now() && $enrollment->status == 'PAUSED') 휴강해제 @endif @if ($enrollment->is_refundable) 출석확인 @endif 수강후기 작성
@endif
@endforeach
@else
{{ $messages[$type] }}
@endif