@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'])
@foreach ($layouts as $index => $item)
@if ($item['name'] === 'logo') @if ($item['value']) Logo @endif @elseif ($item['name'] === 'logoPng') @if ($item['value']) Logo PNG @endif @if ($errors->has($item['name']))
{{ $errors->first($item['name']) }}
@endif @elseif ($item['name'] === 'favicon') @if ($item['value']) Favicon @endif @elseif ($item['name'] === 'fontType') @elseif ($item['name'] === 'fontfamily') @else
@endif
@endforeach