@php $editing = $row !== null; $heading = ($editing ? 'Ubah ' : 'Tambah ').Str::lower($names['singular']); @endphp
@csrf @if ($method !== 'POST') @method($method) @endif @if ($errors->any()) Periksa isian yang ditandai lalu coba lagi. @endif @foreach ($sections as $title => $fields) @foreach ($fields as $field) @php $type = $field['type'] ?? 'text'; $span = ($field['span'] ?? null) === 'full' || $type === 'textarea' ? 'col-span-full' : null; $attrs = $field['attrs'] ?? []; $required = ! ($field['optional'] ?? false) && in_array('required', (array) ($field['rules'] ?? []), true); @endphp
@if ($type === 'select') @elseif ($type === 'textarea') @elseif ($type === 'checkbox') @else @endif
@endforeach
@endforeach {{ $editing ? 'Simpan perubahan' : 'Simpan' }} Batal