{{-- The product's custom fields (boboko-core's Product::$custom_fields), rendered inside the add-to-cart
so their values travel with it as custom_fields[key]. text → input, textarea → textarea, file → photo upload. A photo is uploaded as soon as it's picked (custom-field-upload-controller.js) and only the resulting File row's id (boboko-core's Modules\Core\File\ Models\File) is submitted with the form — the file input itself has no name. It still carries `required`, so the browser's own validation blocks add-to-cart until a photo is picked, and the controller marks it invalid (setCustomValidity) while the upload is in flight. --}} @props(['fields' => []]) @use('App\Http\Controllers\CustomFieldUploadController')
@foreach ($fields as $field) @php $id = 'custom-field-'.$field['key']; $name = 'custom_fields['.$field['key'].']'; $required = (bool) ($field['required'] ?? false); @endphp @switch($field['type']) @case('textarea') @break @case('file') @break @default @endswitch @endforeach