@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
{{ $documents->count() }} document{{ $documents->count() === 1 ? '' : 's' }} on file · {{ $documents->where('is_verified', true)->count() }} verified
@if ($canUpload) @endif| 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' }} |