My Medications

Add
@php $medications = \App\Models\Medication::where('created_by', auth()->id())->latest()->take(4)->get(); @endphp @if($medications->count() > 0)
@foreach($medications as $medication)

{{ $medication->medicine }}

{{ $medication->dosage }} {{ $medication->dosage_unit == 'other' ? $medication->dosage_unit_other : $medication->dosage_unit }}
@if($medication->frequency == 10) {{ $medication->frequency_other }} @else @php $frequencyLabels = [ 1 => 'Once Daily', 2 => 'Twice Daily', 3 => 'Three Times a Day', 4 => 'Four Times a Day', 5 => 'Five Times a Day', 6 => 'Six Times a Day', 9 => 'PRN (As Needed)', 10 => 'Other', ]; @endphp {{ $frequencyLabels[$medication->frequency] ?? '' }} @endif @php $times = []; for ($i = 1; $i <= 6; $i++) { $timeField = 'time_' . $i; if (!empty($medication->$timeField)) { $times[] = \Carbon\Carbon::parse($medication->$timeField)->format('h:i A'); } } @endphp @if(!empty($times)) • {{ implode(', ', $times) }} @endif
@if($medication->route_administration)
{{ ucfirst($medication->route_administration) }}
@endif
@endforeach
@endif