@php $variant = $variant ?? 'pre-pdwp'; $wpPreviewOnly = ! empty($wpPreviewOnly ?? false); $canEditWorkingPaperBody = $canEditWorkingPaperBody ?? true; $canEditAttachments = (bool) $canEditWorkingPaperBody && ! $wpPreviewOnly; $attachmentRows = data_get($data ?? [], 'attachments', []); $attachmentRows = \App\Support\WorkingPaperAttachments::normalizeList($attachmentRows); $tableClass = match ($variant) { 'pdwp' => 'pdwpwp-form', 'ddwp' => 'ddwpwp-form', default => 'prepwp-form', }; $labelClass = match ($variant) { 'pdwp' => 'pdwpwp-label', 'ddwp' => 'ddwpwp-label', default => 'prepwp-label', }; $headRowClass = $variant === 'pdwp' ? 'pdwpwp-h34' : ''; $hideBlock = ! $canEditAttachments && $attachmentRows === []; $workingPaper = $workingPaper ?? null; $canEmbedSaved = $workingPaper instanceof \App\Models\PC\WorkingPaper && (int) $workingPaper->id > 0; @endphp @unless ($hideBlock)
Attached Documents
@if ($attachmentRows !== [])
    @foreach ($attachmentRows as $att)
  1. {{ $att['name'] }} @if ($canEditAttachments) @endif
  2. @endforeach
@if ($canEmbedSaved)
@foreach ($attachmentRows as $att) {!! \App\Support\WorkingPaperAttachments::embedHtml($att, $workingPaper) !!} @endforeach
@endif @elseif ($canEditAttachments)

No documents attached yet.

@endif @if ($canEditAttachments)
PDF, JPG or JPEG. Multiple files allowed (max {{ \App\Support\WorkingPaperAttachments::MAX_FILES }}, 10 MB each). @error('wp_attachments') {{ $message }} @enderror @error('wp_attachments.*') {{ $message }} @enderror
@endif
@endunless @if ($canEditAttachments) @push('scripts') @endpush @endif