@php $cards = [ ['can' => 'clinic.patients.view', 'route' => 'admin.dashboard.clinic.patients.index', 'icon' => 'people', 'color' => 'primary', 'value' => $counters['patients']['total'], 'label' => trans('clinic.home.patients'), 'sub' => trans('clinic.home.new_this_month', ['count' => $counters['patients']['new_this_month']])], ['can' => 'clinic.doctors.view', 'route' => 'admin.dashboard.clinic.doctors.index', 'icon' => 'security-user', 'color' => 'info', 'value' => $counters['doctors']['total'], 'label' => trans('clinic.home.doctors'), 'sub' => trans('clinic.home.active_count', ['count' => $counters['doctors']['active']])], ['can' => 'clinic.clinics.view', 'route' => 'admin.dashboard.clinic.clinics.index', 'icon' => 'bank', 'color' => 'success', 'value' => $counters['clinics']['total'], 'label' => trans('clinic.home.clinics'), 'sub' => trans('clinic.home.active_count', ['count' => $counters['clinics']['active']])], ['can' => 'clinic.specialties.view', 'route' => 'admin.dashboard.clinic.specialties.index', 'icon' => 'category', 'color' => 'dark', 'value' => $counters['specialties']['total'], 'label' => trans('clinic.home.specialties'), 'sub' => trans('clinic.home.active_count', ['count' => $counters['specialties']['active']])], ['can' => 'clinic.offers.view', 'route' => 'admin.dashboard.clinic.offers.index', 'icon' => 'discount', 'color' => 'warning', 'value' => $counters['offers']['total'], 'label' => trans('clinic.home.offers'), 'sub' => trans('clinic.home.running_count', ['count' => $counters['offers']['running']])], // Offer subscriptions have no permission of their own; they belong with offers. ['can' => 'clinic.offers.view', 'route' => 'admin.offer-subscriptions.index', 'icon' => 'notification-status', 'color' => 'danger', 'value' => $counters['subscriptions']['total'], 'label' => trans('clinic.home.subscriptions'), 'sub' => trans('clinic.home.new_requests', ['count' => $counters['subscriptions']['new']]), 'subColor' => $counters['subscriptions']['new'] > 0 ? 'danger' : 'muted'], ]; $revenue = $counters['revenue']; @endphp

{{ trans('clinic.home.overview') }}

@foreach ($cards as $card) @can($card['can'])
@include('dashboard.admin.clinic.home.partials._stat_card', [ 'icon' => $card['icon'], 'color' => $card['color'], 'value' => number_format($card['value']), 'label' => $card['label'], 'sub' => $card['sub'], 'subColor' => $card['subColor'] ?? null, 'href' => route($card['route']), ])
@endcan @endforeach @can('clinic.reports.view')
{{ number_format($revenue['month'], 2) }} {{ trans('clinic.home.revenue') }} {{ trans('clinic.home.revenue_today', ['amount' => number_format($revenue['today'], 2)]) }}
@if ($revenue['change_percent'] !== null) @php $up = $revenue['change_percent'] >= 0; @endphp
{{ abs($revenue['change_percent']) }}%
{{ trans('clinic.home.vs_last_month') }}
@endif
@endcan