@php $data = [ [ "heading" => "Incredible Journey", "fields" => [ ["type" => "text", "label" => "Title", "key" => "s1_title"], ["type" => "textarea", "label" => "Content", "key" => "s1_content"], ["type" => "image", "label" => "Image 1", "key" => "s1_media_id_1"], ["type" => "image", "label" => "Image 2", "key" => "s1_media_id_2"] ] ], [ "heading" => "Quick Support", "fields" => [ ["type" => "text", "label" => "Title", "key" => "s2_title"], ["type" => "textarea", "label" => "Content", "key" => "s2_content"], ["type" => "text", "label" => "Button Text", "key" => "s2_button_text"], ] ], [ "heading" => "Corporate Office", "fields" => [ ["type" => "text", "label" => "Title", "key" => "s3_title"], ["type" => "text", "label" => "Address", "key" => "s3_address"], ["type" => "text", "label" => "Button Text", "key" => "s3_button_text"], ["type" => "text", "label" => "Map", "key" => "s3_map"], ] ], ]; @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