@extends('layouts.admin') @section('title', $config['label']) @section('eyebrow', 'CMS') @section('heading', $config['label']) @section('content') @php $sections = $config['sections'] ?? []; $errorTab = null; foreach ($sections as $section) { foreach ($section['fields'] ?? [] as $field) { if ($errors->has($field['key'])) { $errorTab = $section['id']; break 2; } } } $initialTab = $errorTab ?? ($sections[0]['id'] ?? 'hero'); @endphp
@csrf @method('PUT') @if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif {{-- Section tabs --}}
@foreach ($sections as $section) @endforeach
{{-- Tab panels — all fields stay in the DOM so one Save submits everything --}}
@foreach ($sections as $section)
@isset($section['icon']) @endisset

{{ $section['label'] }}

{{ $section['hint'] ?? 'Edit this section, then save — all tabs are saved together.' }}

@foreach ($section['manage'] ?? [] as $link) @endforeach @forelse ($section['fields'] ?? [] as $field)
! in_array($field['type'] ?? 'text', ['textarea', 'image'], true), 'sm:col-span-2' => in_array($field['type'] ?? 'text', ['textarea', 'image'], true), ])> @if (($field['type'] ?? 'text') === 'image') @else @if (($field['type'] ?? 'text') === 'textarea') @else @endif @endif @error($field['key'])

{{ $message }}

@enderror
@empty @if (empty($section['manage']))

No text fields in this section.

@endif @endforelse
@endforeach

Saving updates every section on this page.

@endsection