@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')