@extends('admin.layouts.app') @php /** @var class-string<\App\Admin\Resource> $resource */ $editing = $record !== null; $heading = $editing ? 'Edit '.$resource::$singular : 'Add '.$resource::$singular; $sections = collect($resource::formFields(! $editing))->groupBy(fn ($field) => $field->section ?? ''); $backUrl = $editing ? route($resource::routeName('show'), $record) : route($resource::routeName('index')); @endphp @section('title', $heading) @section('page-title', $resource::$label) @section('content')

{{ $heading }}@if($editing) {{ $resource::title($record) }}@endif

@include('admin.partials.icon', ['name' => 'back']) Back
@csrf @if($editing) @method('PUT') @endif
@foreach($sections as $section => $fields) @if($section !== '' && $sections->count() > 1)

{{ $section }}

@endif @foreach($fields as $field) @include('admin.resource._field', ['field' => $field, 'record' => $record]) @endforeach @endforeach
Cancel
@endsection