@foreach ($fields as $name => $field)
@php
$type = $field['type'] ?? 'text';
$current = old($name, $record?->{$name});
$isChecked = old($name, $field['default'] ?? null);
$inputId = 'field-' . $name;
$helpId = $inputId . '-help';
@endphp
@endforeach
@yield('extra-fields')