@forelse ($locations as $location) @php $sql = DB::table('locations') ->where('parent_id', '=', $location->id) ->get(); $no = 1; @endphp {{ $loop->index + 1 }} {{ $location->name }} {{ $location->description ?? '-' }} @php $items = explode(',', $location->dokter_id); @endphp @if (!empty($items)) @foreach ($items as $item) @php $item = trim($item); $sqlDokter = DB::table('users') ->where('id', '=', $item) ->first(); @endphp {!! optional($sqlDokter)->name ? optional($sqlDokter)->name . '
' : '' !!} @endforeach @endif @foreach ($sql as $row) @php $no++; @endphp @endforeach
NO NAME DESCRIPTION DOCTOR ON DUTY ACTION
{{ $no }} {{ $row->name }} {{ $row->description }} @php $items = explode(',', $row->dokter_id); @endphp @if (!empty($items)) @foreach ($items as $item) @php $item = trim($item); $sqlDokter = DB::table('users') ->where('id', '=', $item) ->first(); @endphp {{$sqlDokter->name ?? '-'}}
@endforeach @endif
@empty @include('components.empty.empty-state') @endforelse