@extends('site.layout')
@section('content')
@php
use App\Helpers\Site;
$heroImg = Site::img(Site::get('hero_image'));
$stats = [];
foreach ([1, 2, 3, 4] as $i) { if (Site::get("stat{$i}_value")) { $stats[] = [Site::get("stat{$i}_value"), Site::get("stat{$i}_label")]; } }
$feats = [];
foreach ([1, 2, 3] as $i) { if (Site::get("feature{$i}_title")) { $feats[] = [Site::get("feature{$i}_title"), Site::get("feature{$i}_text")]; } }
$welcomeImg = Site::img(Site::get('welcome_image'));
@endphp
{{-- HERO / SLIDER --}}
@forelse($sliders as $s)
{{ Site::name() }}
{{ $s->title }}
@if($s->subtitle)
{{ $s->subtitle }}
@endif
@if($s->button_text)
{{ $s->button_text }}@endif
@empty
@endforelse
@if($sliders->count() > 1)
@foreach($sliders as $s)@endforeach
@endif
{{-- STATS --}}
@if($stats)
@foreach($stats as $st)
{{ $st[0] }}{{ $st[1] }}
@endforeach
@endif
{{-- WELCOME --}}
About our school
{{ Site::get('welcome_title', 'Welcome') }}
{!! Site::format(Site::get('welcome_text')) !!}
@if(Site::get('principal_name'))
{{ Site::get('principal_name') }}{{ Site::get('principal_title') }}
@endif
Learn more about us
@if($welcomeImg)

@endif
{{-- HIGHLIGHTS --}}
@if($feats)
Why choose us
A school your child will love
@foreach($feats as $f)
{{ $loop->iteration }}
{{ $f[0] }}
{{ $f[1] }}
@endforeach
@endif
{{-- PORTAL --}}
School portal
Results, fees, attendance and more — online
Students, parents and staff can log in to the school portal to see results, pay and track fees, check attendance and read school announcements.
{{-- NEWS + EVENTS --}}
@if($news->count() || $events->count())
@if($news->count())
Latest news
What's happening at school
All news
@foreach($news as $post)@include('site._card', ['post' => $post])@endforeach
@endif
@if($events->count())
@foreach($events as $ev)
@php $d = \Carbon\Carbon::parse($ev->event_date); @endphp
{{ $d->format('d') }}{{ $d->format('M Y') }}
{{ trim(($ev->event_time ?: '').($ev->event_time && $ev->location ? ' ยท ' : '').($ev->location ?: '')) }}
@endforeach
@endif
@endif
{{-- GALLERY --}}
@if($gallery->count())
![]()
@endif
{{-- CTA --}}
@endsection