@extends('admin.layouts.app') @section('title', __('dashboard.title')) @section('breadcrumb') @endsection @section('content') @php $currency = __('dashboard.currency_symbol'); $canViewFinancial = (bool) ($canViewFinancial ?? false); $chartLabels = $appointmentsBySpecialty->pluck('specialty_name')->take(7)->values(); $chartAppointmentValues = $appointmentsBySpecialty->pluck('appointments_count')->take(7)->values(); $chartRevenueLabels = $revenueBySpecialty->pluck('specialty_name')->take(6)->values(); $chartRevenueValues = $revenueBySpecialty->pluck('revenue_total')->map(fn ($value) => (float) $value)->take(6)->values(); $chartDoctorLabels = $doctorsBySpecialty->pluck('specialty_name')->take(6)->values(); $chartDoctorValues = $doctorsBySpecialty->pluck('doctors_count')->take(6)->values(); @endphp
{{ __('dashboard.hero.badge') }}

{{ __('dashboard.hero.title') }}

{{ __('dashboard.hero.subtitle') }}

@if (Route::has('admin.appointments.create')) {{ __('dashboard.actions.new_appointment') }} @endif @if (Route::has('admin.patients.create')) {{ __('dashboard.actions.new_patient') }} @endif @if (Route::has('admin.reports.index')) {{ __('dashboard.actions.open_reports') }} @endif
@if ($canViewFinancial)
{{ __('dashboard.hero.monthly_revenue') }}
{{ $currency }}{{ number_format($monthlyRevenue, 2) }}
{{ __('dashboard.hero.today_revenue') }}: {{ $currency }}{{ number_format($todayRevenue, 2) }}
@else
{{ __('dashboard.title') }}
{{ __('dashboard.stats.today_appointments') }}: {{ number_format($todayAppointments) }}
{{ __('dashboard.stats.waiting_list') }}: {{ number_format($waitingListRequests) }}
@endif
{{ __('dashboard.stats.patients') }}
{{ number_format($totalPatients) }}
{{ __('dashboard.stats.today_appointments') }}
{{ number_format($todayAppointments) }}
{{ __('dashboard.stats.waiting_list') }}
{{ number_format($waitingListRequests) }}
@if ($canViewFinancial)
{{ __('dashboard.stats.today_revenue') }}
{{ $currency }}{{ number_format($todayRevenue, 2) }}
{{ __('dashboard.stats.monthly_revenue') }}
{{ $currency }}{{ number_format($monthlyRevenue, 2) }}
@endif
{{ __('dashboard.charts.appointments_title') }}

{{ __('dashboard.charts.appointments_subtitle') }}

@if ($canViewFinancial)
{{ __('dashboard.charts.revenue_title') }}

{{ __('dashboard.charts.revenue_subtitle') }}

@endif
{{ __('dashboard.recent_appointments') }}
@if (Route::has('admin.appointments.index')) {{ __('dashboard.actions.view_all') }} @endif
    @forelse ($recentAppointments as $item) @php $statusValue = (string) ($item->status_value ?? $item->status ?? 'pending'); $statusKey = 'appointments.status.' . $statusValue; $statusText = __($statusKey); $statusText = $statusText === $statusKey ? ucfirst($statusValue) : $statusText; $statusBadgeClass = match ($statusValue) { 'completed' => 'text-bg-success', 'confirmed', 'checked_in', 'in_progress' => 'text-bg-primary', 'cancelled', 'cancelled_by_patient', 'cancelled_by_clinic', 'no_show' => 'text-bg-danger', default => 'text-bg-secondary', }; @endphp
  • {{ $item->patient_name }}
    {{ $item->doctor ?? __('common.not_available') }}
    {{ $item->appointment_time }}
    {{ $statusText }}
  • @empty
  • {{ __('dashboard.empty.recent_appointments') }}
  • @endforelse
{{ __('dashboard.latest_patients') }}
@if (Route::has('admin.patients.index')) {{ __('dashboard.actions.view_all') }} @endif
    @forelse ($latestPatients as $patient)
  • {{ $patient->name }}
    {{ $patient->phone }}
    {{ isset($patient->created_at) ? $patient->created_at->diffForHumans() : '' }}
  • @empty
  • {{ __('dashboard.empty.patients') }}
  • @endforelse
{{ __('dashboard.charts.doctors_title') }}

{{ __('dashboard.charts.doctors_subtitle') }}

@if ($canViewFinancial)
{{ __('dashboard.recent_invoices') }}
@if (Route::has('admin.billing.invoices.index')) {{ __('dashboard.actions.view_all') }} @endif
    @forelse ($recentInvoices as $invoice) @php $invoiceStatus = (string) ($invoice->status_value ?? $invoice->status ?? 'pending'); $invoiceBadgeClass = match ($invoiceStatus) { 'paid' => 'text-bg-success', 'partially_paid' => 'text-bg-warning', 'overdue', 'cancelled', 'void' => 'text-bg-danger', default => 'text-bg-secondary', }; @endphp
  • {{ $invoice->invoice_no }}
    {{ $invoice->patient_name }}
    {{ $currency }}{{ number_format((float) ($invoice->total ?? 0), 2) }}
    {{ str($invoiceStatus)->replace('_', ' ')->title() }}
  • @empty
  • {{ __('dashboard.empty.invoices') }}
  • @endforelse
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush