@php $data = $data ?? []; $template_layouts = config('settings.layouts'); $layouts = array_map(function($template_layout) use ($data) { $existing_layout = collect($data)->firstWhere('name', $template_layout['name']); if ($existing_layout) { foreach ($template_layout as $key => $value) { if (!isset($existing_layout[$key]) || empty($existing_layout[$key])) { $existing_layout[$key] = $value; } } return $existing_layout; } return $template_layout; }, $template_layouts); $selectedFontFamily = collect($layouts)->firstWhere('name', 'fontfamily')['value'] ?? ''; $selectedFontType = ''; foreach ($fontData as $type => $fonts) { if (in_array($selectedFontFamily, $fonts)) { $selectedFontType = $type; break; } } @endphp @include('layouts.components.section-marker', ['section_name' => 'Website Layouts'])