@extends('layouts.app') @php $eyebrow = ($row ? 'Edit' : 'New').' '.\Illuminate\Support\Str::singular($title); $pageTitle = $row ? "Edit {$title}" : "New ".\Illuminate\Support\Str::singular($title); @endphp @section('content')
@csrf @if($row) @method('PUT') @endif
@foreach($fields as $f) @php $type = $f['type'] ?? null; $val = old($f['name'], $row?->{$f['name']}); $wide = in_array($type, ['textarea']); @endphp
@if($type === 'textarea') @elseif($type === 'select') @elseif($type === 'reference') @elseif($type === 'checkbox')
@elseif(in_array($type, ['file', 'image'])) @if($val)
@if($type === 'image') @else Current file @endif
@endif @elseif($type === 'money')
$
@else @endif @error($f['name'])
{{ $message }}
@enderror
@endforeach
Cancel
@endsection