@props([ 'record', 'route', 'title' => null, 'multipart' => true, ]) {{-- Wraps a create/edit form: routes to store or update, adds CSRF and buttons. --}} @php $editing = $record?->exists; $action = $editing ? route('admin.'.$route.'.update', $record) : route('admin.'.$route.'.store'); @endphp
@csrf @if ($editing) @method('PUT') @endif
@if ($title)
{{ $title }}
@endif
{{ $slot }}