@php $documents = $patient->documents->sortByDesc('created_at'); $canUpload = auth()->user()->can('patient-documents.upload'); $canDelete = auth()->user()->can('patient-documents.delete'); $canVerify = auth()->user()->can('patient-insurances.manage'); $humanSize = function (?int $bytes): string { if (! $bytes) { return '—'; } return $bytes >= 1048576 ? number_format($bytes / 1048576, 1).' MB' : number_format(max($bytes, 1) / 1024).' KB'; }; @endphp
@if ($documents->isEmpty()) @if ($canUpload) @endif @else

{{ $documents->count() }} document{{ $documents->count() === 1 ? '' : 's' }} on file · {{ $documents->where('is_verified', true)->count() }} verified

@if ($canUpload) @endif
@foreach ($documents as $document) @endforeach
Document Number Expiry Size Filed

{{ $document->title }}

{{ $document->original_name }}

{{ $document->document_number ?: '—' }} @if ($document->expiry_date) {{ $document->expiry_date->toDateString() }} {{ $document->expiry_date->isPast() ? 'expired' : 'in '.$document->expiry_date->diffForHumans(null, true) }} @else — @endif {{ $humanSize($document->size_bytes) }} {{ $document->created_at?->format('d M Y') }} {{ $document->uploader?->name ?? 'system' }}
@if ($document->is_verified) @elseif ($canVerify)
@csrf @method('PATCH')
@else @endif Open Download @if ($canDelete)
@csrf @method('DELETE')
@endif
@endif @if ($canUpload)
@csrf

Upload document

Stored on the private disk against {{ $patient->full_name }}. JPEG, PNG, WebP or PDF, up to 8 MB.

@error('file')

{{ $message }}

@enderror
@endif