@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
|
|
| NO |
NAME |
DESCRIPTION |
DOCTOR ON DUTY |
ACTION |
@foreach ($sql as $row)
| {{ $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
|
|
@php $no++; @endphp
@endforeach
|
@empty