@php $selectedFontFamily = collect($data)->firstWhere('name', 'fontfamily')['value'] ?? ''; $selectedSecondaryFontFamily = collect($data)->firstWhere('name', 'secondaryFontFamily')['value'] ?? ''; $selectedFontType = ''; $selectedSecondaryFontType = ''; foreach ($fontData as $type => $fonts) { if ($selectedFontType === '' && in_array($selectedFontFamily, $fonts)) { $selectedFontType = $type; } if ($selectedSecondaryFontType === '' && in_array($selectedSecondaryFontFamily, $fonts)) { $selectedSecondaryFontType = $type; } if ($selectedFontType !== '' && $selectedSecondaryFontType !== '') { break; } } $fontSelectConfigs = [ [ 'type_id' => 'fontType', 'family_id' => 'fontFamily', 'selected_type' => $selectedFontType, 'selected_family' => $selectedFontFamily, ], [ 'type_id' => 'secondaryFontType', 'family_id' => 'secondaryFontFamily', 'selected_type' => $selectedSecondaryFontType, 'selected_family' => $selectedSecondaryFontFamily, ], ]; @endphp @include('layouts.components.section-marker', ['section_name' => 'Website Layouts'])