@foreach ($def['fields'] as $col => $f)
@php
$type = $f['type'] ?? 'text';
$locked = $row && ($f['locked'] ?? false);
$value = old($col, $row?->{$col} ?? ($f['default'] ?? null));
$required = str_contains($f['rules'] ?? '', 'required');
@endphp
@if ($type === 'checkbox')
@else
@if ($type === 'select')
@elseif ($type === 'textarea')
@else
@endif
@error($col)
{{ $message }}
@enderror
@if (!empty($f['help']))
{{ $f['help'] }}
@endif
@endif
@endforeach