| {{ $index + 1 }} |
{{-- แสดงเสมอ --}}
{{ $w->WATeaching_title }} |
{{-- Unit (ถ้ายังไม่มี regular จะเป็น -) --}}
@php
$unitRow = $teachings
->where('teaching_name', $w->WATeaching_id)
->first();
@endphp
{{ $unitRow->unit_name ?? '-' }} |
{{-- dynamic teaching_type columns --}}
@foreach ($teaching_types as $item)
@php
$value = $teachings
->where('teaching_name', $w->WATeaching_id)
->where('teaching_type_id', $item->teaching_type_id)
->first();
@endphp
{{ $value->teaching_value ?? '-' }}
|
@endforeach
@endforeach