@php use App\Helpers\Helper; @endphp @push('styles') @endpush
@php $principalEn = $principal->information_en ?? []; $principalNp = $principal->information_np ?? []; $isEn = app()->getLocale() === 'en'; // Nepali title/details fall back to English when left blank $hourCards = $setting->schoolHours('en'); if (!$isEn) { $np = $setting->schoolHours('np'); $hourCards = $hourCards ? array_map(fn($card, $i) => array_merge($card, array_filter($np[$i] ?? [])), $hourCards, array_keys($hourCards)) : $np; } $hourGroups = array_map(fn($card) => [ 'title' => $card['title'] ?? '', 'rows' => \App\Models\Setting::schoolHourRows($card['details'] ?? ''), ], $hourCards); $contact1 = json_decode($setting->contact1); $contact2 = json_decode($setting->contact2); @endphp
{{ $isEn ? $principalEn['name'] ?? '' : $principalNp['name'] ?? ($principalEn['name'] ?? '') }}

{{ $isEn ? $principalEn['name'] ?? '' : $principalNp['name'] ?? ($principalEn['name'] ?? '') }}

{{ $isEn ? $principalEn['designation'] ?? '' : $principalNp['designation'] ?? ($principalEn['designation'] ?? '') }}

{!! Helper::stripInlineStyle( $isEn ? $principalEn['description'] ?? '' : $principalNp['description'] ?? ($principalEn['description'] ?? ''), ) !!}
{{ __('pages.read_more') }}

{!! Helper::content('homepage.welcome_to_gbbs') !!}

{!! Helper::stripInlineStyle( $isEn ? $setting['description_en'] : $setting['description_np'] ?? $setting['description_en'], ) !!}
@php $phones = collect([$contact1, $contact2])->filter(fn($c) => !empty($c?->contact)); @endphp @if ($hourGroups || $phones->isNotEmpty())

{{ $hourGroups ? Helper::contentText('homepage.school_hrs') : Helper::contentText('homepage.contact_us_247') }}

@if ($phones->isNotEmpty())
@foreach ($phones as $contact) {{ $contact->contact }} @endforeach
@endif
@if ($hourGroups)
@foreach ($hourGroups as $group)

{{ $group['title'] }}

@foreach ($group['rows'] as $row) @if (isset($row['sub']))

{{ $row['sub'] }}

@elseif (isset($row['label']))

{{ $row['label'] }} {{ $row['value'] }}

@else

{{ $row['text'] }}

@endif @endforeach
@endforeach
@endif
@endif
@push('scripts') @endpush