{{-- @include('checkout::partials.line-custom-fields', ['line' => $line]) A cart or order line's custom-field answers (meta.custom_fields, written by Cart\Http\Controllers\CartController::customFieldsMeta()). A file answer only carries a File id (Modules\Core\File\Models\File is the source of truth for name/mime/disk/path — never duplicated into meta), resolved here and linked through the signed download route (files.download), minted fresh on every render, with a thumbnail when the browser can display the format (HEIC can't be shown outside Safari, so it gets the name only). --}} @php $fields = $line->meta['custom_fields'] ?? []; $previewable = ['image/jpeg', 'image/png', 'image/webp', 'image/gif']; @endphp @if (! empty($fields))
@foreach ($fields as $field)
{{ $field['label'] }}
@if ($field['type'] === 'file') @php $file = \Modules\Core\File\Models\File::find($field['file_id'] ?? null); @endphp @if ($file) @php $fileUrl = \Illuminate\Support\Facades\URL::temporarySignedRoute( 'files.download', now()->addHours(2), ['file' => $file->id], ); @endphp @if (in_array($file->mime, $previewable, true)) @endif {{ $file->original_name }} @endif @else {{ $field['value'] }} @endif
@endforeach
@endif