@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'])
@foreach ($data as $index => $item)
@if ($item['name'] === 'logo') @if ($item['value']) Logo Header @endif @elseif ($item['name'] === 'logoEmail') @if ($item['value']) Logo Email @endif @if ($errors->has($item['name']))
{{ $errors->first($item['name']) }}
@endif @elseif ($item['name'] === 'logoFooter') @if ($item['value']) Logo Footer @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') @elseif ($item['name'] === 'secondaryFontType') @elseif ($item['name'] === 'secondaryFontFamily') @elseif ($item['name'] === 'buttonsAnimations')
@else @include('layouts.components.color-input', [ 'id' => $index, 'name' => 'layouts[' . $index . '][value]', 'value' => $item['value'] ]) @endif
@endforeach