@php $contacts = $patient->contacts->sortByDesc('is_primary'); $canManage = auth()->user()->can('patients.edit'); $flags = [ 'is_primary' => ['label' => 'Primary', 'color' => 'blue'], 'is_next_of_kin' => ['label' => 'Next of kin', 'color' => 'indigo'], 'is_emergency_contact' => ['label' => 'Emergency', 'color' => 'rose'], 'is_guarantor' => ['label' => 'Guarantor', 'color' => 'teal'], ]; @endphp
{{ $contacts->count() }} contact{{ $contacts->count() === 1 ? '' : 's' }} on file.
@if ($canManage) @endif{{ $contact->relationship_label }}
{{ $contact->notes }}
@endif @if ($canManage)