@if($fields === [])
Content is hardcoded. The blade renders its own copy for this section, so there is nothing to save here yet.
Visibility and Style above still work. We'll open up its content when we do this section.
@else
@php $content = (array) old('content', (array) $section->content); @endphp
@if($liveCount === 0 && $fields !== [])
None of these fields reach the page yet. The blade is still using its built-in copy for this section.
Values save fine — they'll start showing the moment we wire the blade, which we'll do section by section.
@elseif($liveCount < count($fields))
Fields marked "not applied yet" are saved but not read by the page's blade — those get wired up section by section.
The rest take effect immediately.
@endif
@foreach($fields as $fk => $fd)
@php
$type = $fd['type'] ?? 'text';
$labelF = $fd['label'] ?? $fk;
$isLive = isset($reads[$fk]);
$isIconField = $type === 'text'
&& (strtolower((string) $fk) === 'icon'
|| str_contains(strtolower((string) $labelF), 'icon'));
@endphp
@if($type === 'repeater')
{{ $labelF }}
@if($isLive)● live @else● not applied yet @endif
@php $rowsData = is_array($content[$fk] ?? null) ? $content[$fk] : []; @endphp
@forelse($rowsData as $ri => $r)
#{{ $ri + 1 }}
Remove
@foreach(($fd['fields'] ?? []) as $sk => $sd)
@php
$stype = $sd['type'] ?? 'text';
// a plain text field holding a Font Awesome class gets the library
$sisIcon = $stype === 'text'
&& (strtolower((string) $sk) === 'icon'
|| str_contains(strtolower((string) ($sd['label'] ?? '')), 'icon'));
@endphp
{{ $sd['label'] ?? $sk }}
@if($stype === 'textarea')
@elseif($stype === 'color')
@elseif($stype === 'select')
@foreach(($sd['options'] ?? []) as $ov => $ol)
{{ $ol }}
@endforeach
@elseif($stype === 'repeater')
@php
$nkey = $fk . '|' . $ri . '|' . $sk;
$nrows = is_array($r[$sk] ?? null) ? $r[$sk] : [];
$nfields = (array) ($sd['fields'] ?? []);
@endphp
@forelse($nrows as $ci => $cr)
#{{ $ci + 1 }}
Remove
@foreach($nfields as $ck => $cd)
@php
$ctype = $cd['type'] ?? 'text';
$cname = 'content[' . $fk . '][' . $ri . '][' . $sk . '][' . $ci . '][' . $ck . ']';
$cval = is_array($cr[$ck] ?? null) ? '' : (string) ($cr[$ck] ?? '');
$cisIcon = $ctype === 'text'
&& (strtolower((string) $ck) === 'icon'
|| str_contains(strtolower((string) ($cd['label'] ?? '')), 'icon'));
$cpid = 'n-' . $nkey . '-' . $ci . '-' . $ck;
@endphp
@endforeach
@empty
No rows yet.
@endforelse
+ Add {{ Str::lower(Str::before($sd['label'] ?? $sk, ' (')) }}
@else
@if($sisIcon)
@php
$pid = 'c-' . $fk . '-' . $ri . '-' . $sk;
$cur = (string) ($r[$sk] ?? '');
@endphp
{!! $cur !== '' ? ' ' : ' ' !!}
@else
@endif
@endif
@endforeach
@empty
No rows yet — the page is showing its built-in defaults.
@endforelse
+ Add {{ Str::lower(Str::before($labelF, ' (')) }}
@elseif($type === 'textarea')
{{ $labelF }}
@if($isLive)● live @else● not applied yet @endif
@elseif($type === 'color')
@elseif($type === 'select')
{{ $labelF }}
@if($isLive)● live @else● not applied yet @endif
@foreach(($fd['options'] ?? []) as $ov => $ol)
{{ $ol }}
@endforeach
@else
@endif
@endforeach
@endif