@php $data = [ [ "heading" => "Banner Content", "fields" => [ ["type" => "text", "label" => "Title", "key" => "s1_title"], ["type" => "image", "label" => "Banner Image", "key" => "s1_media_id"], ] ], [ "heading" => "Gallery", "fields" => [ ["type" => "text", "label" => "Title", "key" => "s2_title"], ] ], ]; @endphp @foreach($data as $section)

{{ $section['heading'] }}

@foreach($section['fields'] as $field) @include("admin.static_pages._partials.inputs.{$field['type']}", [ "label" => $field['label'], "key" => $field['key'], "value" => $obj->content[$field['key']] ?? ($field['type'] === 'image' ? null : '') ]) @endforeach @endforeach