@extends('layouts.app')
@section('title', 'Dashboard')
@section('content')
@php $u = auth()->user(); @endphp
{{-- ---------------- Quick Links ---------------- --}}
{{-- ---------------- Patient Summary ---------------- --}}
@if($u->canManagePatients())
Patient Summary
Total Patients
{{ $totalPatients }}
Today's Patients
{{ $todaysPatients }}
Upcoming Follow-ups
{{ $upcomingFollowUps->count() }}
Recent Visits
{{ $latestVisits->count() }}
Today's Patient Fee
{{ number_format($todaysFees->total_fee, 2) }}
Today's Received Fee
{{ number_format($todaysFees->total_received, 2) }}
Today's Remaining Fee
{{ number_format($todaysFees->total_remaining, 2) }}
Today's Discount Fee
{{ number_format($todaysFees->total_discount, 2) }}
Recent Patients
| Serial | Name | Last Visit |
@forelse($recentPatients as $p)
| {{ $p->serial_number }} | {{ $p->name }} | {{ optional($p->latestVisit)->visit_date?->format('d M Y') ?? '—' }} |
@empty
| No patients yet. |
@endforelse
Follow-up Patients
| Patient | Doctor | Date |
@forelse($upcomingFollowUps as $v)
| {{ $v->patient->name ?? '—' }} | {{ $v->doctor_name ?? '—' }} | {{ $v->follow_up_date?->format('d M Y') }} |
@empty
| No upcoming follow-ups. |
@endforelse
Latest Patient Records
| Patient | Visit | Status |
@forelse($latestVisits as $v)
| {{ $v->patient->name ?? '—' }} | {{ $v->visit_date->format('d M Y') }} | {{ $v->statusLabel() }} |
@empty
| No visits yet. |
@endforelse
@endif
{{-- ---------------- Ingredient Inventory Summary ---------------- --}}
@if($u->canManageInventory())
Ingredient Inventory Summary
Total Ingredients
{{ $totalIngredients }}
Ingredient Categories
{{ $totalIngredientCategories }}
Low Stock (< 100 g)
{{ $lowStockIngredients->count() }}
Out of Stock
{{ $outOfStockIngredients->count() }}
Low / Out of Stock Ingredients
Recent Stock Entries
@forelse($recentStockEntries as $e)
- IN {{ $e->ingredient->name ?? '—' }} ({{ \App\Models\Ingredient::trimNum($e->quantity) }} {{ $e->unit }}) from {{ $e->supplier_name }} — {{ $e->date->format('d M') }}
@empty
- No recent stock entries.
@endforelse
Recent Ingredient Usage
@forelse($recentUsages as $us)
- OUT {{ $us->ingredient->name ?? '—' }} ({{ \App\Models\Ingredient::trimNum($us->quantity) }} {{ $us->unit }}) — {{ $us->usage_date->format('d M') }}
@empty
- No recent usage.
@endforelse
{{-- ---------------- Product Summary ---------------- --}}
Total Products
{{ $totalProducts }}
Low Stock Products
{{ $lowStockProducts->count() }}
Out of Stock Products
{{ $outOfStockProducts->count() }}
Today's Sales
{{ number_format($todaysSales->total, 2) }}
{{ $todaysSales->count }} invoice(s)
@endif
@endsection