Documents that will be attached
Merged into the end of each DSAR letter PDF, and attached to the email
for institutions contacted by email.
@foreach($attachments as $attachment)
@php $document = $attachment['document']; @endphp
$attachment['willMerge'],
'mdi-file-alert-outline text-warning' => $attachment['exists'] && !$attachment['willMerge'],
'mdi-file-remove-outline text-danger' => !$attachment['exists'],
]) style="font-size:1.4rem;">
{{ $attachment['type'] }}
@unless($attachment['exists'])
Not on file
@elseif(!$attachment['willMerge'])
Won't merge into the letter
@endunless
@if($document)
{{ $document->display_name ?: $document->file_name }}
· {{ $document->file_type ?: 'unknown type' }}
{{-- file_size is cast to a formatted string (App\Casts\FileSize),
so it is printed as-is rather than divided. --}}
@if($document->getRawOriginal('file_size'))
· {{ $document->file_size }}
@endif
· uploaded {{ $document->created_at?->format('d M Y') }}
@if(!$attachment['exists'])
Recorded against the client but the file is missing from storage,
so the send will skip it.
@elseif(!$attachment['willMerge'])
Only PDFs and images can be merged into the letter. This still goes
out as an email attachment, but posted letters won't include it.
@endif
@else
No {{ $attachment['type'] }} has been uploaded for this client.
@endif
@if($document && $attachment['exists'])
@endif
@endforeach
@if($missing->isNotEmpty())
{{ $missing->pluck('type')->implode(' and ') }}
{{ $missing->count() === 1 ? 'is' : 'are' }} not available, so
{{ $missing->count() === 1 ? 'it' : 'they' }} won't be sent with this batch.
Sending is still allowed — check with the file handler first if the
institution requires authority before releasing records.
@elseif($unmergeable->isNotEmpty())
Some documents can't be merged into the posted letter — see above.
@endif