@extends('layouts.admin') @section('title', ($row ? 'Edit' : 'Add').' · '.$def['title']) @section('content')
@csrf @if ($row) @method('PUT') @endif
@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
@endsection