{{-- The client custom fields a customer fills in: the profile, and the checkout for fields flagged "show on order form". $fields CustomField collection to render $clientId the account whose saved values prefill them (null: a new one) --}}
@foreach($fields as $field) @php($value = old("custom_fields.{$field->id}", $field->valueFor($clientId)))
field_type === 'textarea') style="grid-column:span 2;" @endif> @if($field->field_type === 'textarea') @elseif($field->field_type === 'select') @elseif($field->field_type === 'checkbox')
@elseif($field->field_type === 'number') required) required @endif> @elseif($field->field_type === 'date') required) required @endif> @else regex) pattern="{{ $field->regex }}" @endif @if($field->required) required @endif> @endif @error("custom_fields.{$field->id}")
{{ $message }}
@enderror
@endforeach