@php $settings = $pageBuilder['settings']; $identity = $pageBuilder['identity']; $localized = fn($value) => data_get($value, $locale) ?: data_get($value, 'en') ?: data_get($value, 'ar'); $heroImage = $identity['hero_image'] ? uploads($identity['hero_image']) : null; $enabledSections = $pageSections; $socialLinks = $settings['social_links'] ?? (array) data_get($branch->settings, 'portfolio', []); $contactEmail = data_get($socialLinks, 'email', data_get($branch->settings, 'portfolio.email')); $contactPhone = data_get($socialLinks, 'phone', data_get($branch->settings, 'portfolio.phone')); @endphp
@if ($settings['show_hero'])

{{ $localized($settings['welcome']) ?: $branch->title }}

@if ($localized($settings['subtitle']))

{{ strip_tags(html_entity_decode($localized($settings['subtitle']), ENT_QUOTES | ENT_HTML5, 'UTF-8')) }}

@endif
@endif @include('website.branches.portfolio.partials.advertisements') @if ($settings['show_install_pwa'])
@endif
@foreach ($enabledSections as $section) @php $sectionStores = $section['stores']; $rows = max(1, (int) ($section['max_rows'] ?? 2)); $columns = max(1, (int) $section['columns']); // A wide mosaic tile occupies two tracks beside the smaller tiles. $mosaicColumns = $columns === 1 ? 1 : $columns + 1; $capacity = match ($section['layout']) { 'grid', 'mosaic' => $columns * $rows, 'featured' => 1 + 2 * ($rows - 1), 'list' => $rows, default => $sectionStores->count(), }; if ($section['layout'] === 'mosaic') { $capacity = 0; $mosaicRow = 1; $usedTracks = 0; foreach ($sectionStores as $unusedStore) { $span = $capacity % 5 === 0 ? min(2, $mosaicColumns) : 1; if ($usedTracks + $span > $mosaicColumns) { $mosaicRow++; $usedTracks = 0; } if ($mosaicRow > $rows) break; $usedTracks += $span; $capacity++; } } if ($section['visible_limit'] ?? null) $capacity = min($capacity, (int) $section['visible_limit']); $sectionStores = $sectionStores->take($capacity); $sectionBackground = $section['background_image'] ? uploads($section['background_image']) : null; $imageDisplay = $section['image_display'] ?? 'auto'; if ($imageDisplay === 'auto') { $imageDisplay = in_array($section['layout'], ['grid', 'grid_slider', 'mosaic']) && (int) $section['columns'] === 1 && in_array($section['image_ratio'], ['wide', 'landscape']) ? 'full' : 'inset'; } @endphp @if ($sectionStores->isNotEmpty())
@if ($localized($section['title']) || $localized($section['subtitle']))
@if ($localized($section['title']))

{{ $localized($section['title']) }}

@endif @if ($localized($section['subtitle']))

{{ strip_tags(html_entity_decode($localized($section['subtitle']), ENT_QUOTES | ENT_HTML5, 'UTF-8')) }}

@endif
@if ($section['show_view_all']) @endif
@endif @if ($section['layout'] === 'grid_slider')
$sectionStores->count() > $columns * $rows]) tabindex="0" aria-label="{{ $localized($section['title']) }}"> @foreach ($sectionStores->chunk($section['columns'] * ($section['max_rows'] ?? 2)) as $slideStores)
@foreach ($slideStores as $store) @include('website.branches.portfolio.builder.store', ['store' => $store, 'section' => $section, 'featured' => false, 'expanded' => false]) @endforeach
@endforeach
@if ($sectionStores->count() > $section['columns'] * ($section['max_rows'] ?? 2))
@lang('qr_builder.swipe_more')
@endif @else
@foreach ($sectionStores as $store) @include('website.branches.portfolio.builder.store', [ 'store' => $store, 'section' => $section, 'featured' => $section['layout'] === 'featured' && $loop->first, 'expanded' => $section['layout'] === 'list', ]) @endforeach
@endif
@if ($section['show_view_all']) @endif @foreach (($section['category_sections'] ?? collect()) as $nestedSection) @endforeach @endif @endforeach
@if ($settings['show_contact'] && ($contactEmail || $contactPhone || collect($socialLinks)->only(['facebook', 'instagram', 'twitter', 'linkedin', 'youtube', 'snapchat', 'tiktok'])->filter()->isNotEmpty()))
@if (filled(data_get($settings, 'contact_label.'.$locale))){{ data_get($settings, 'contact_label.'.$locale) }}@endif

@lang('global.contact_us')

@endif