@extends('public.layout.app') @section('title', __('front.home')) @php $pageSummary = function ($page, $fallback, $limit = 210) { if ($page && ! empty($page->body)) { return \Illuminate\Support\Str::limit(trim(strip_tags($page->body)), $limit); } return $fallback; }; $about = $pages['about'] ?? null; $mission = $pages['mission'] ?? null; $vision = $pages['vision'] ?? null; $career = $pages['career'] ?? null; $heroBackground = ! empty($websiteSettings['home_hero_image']) ? asset('storage/' . $websiteSettings['home_hero_image']) : asset('images/afghan-online-education/logo.png'); $homeUrl = function ($value, $fallback) { $value = trim((string) $value); if ($value === '') { return $fallback; } if (\Illuminate\Support\Str::startsWith($value, ['http://', 'https://', '#'])) { return $value; } return url($value); }; \App\Models\Finance\ModuleSetting::ensureDefaults(); $publicFormVisible = fn ($key) => \App\Models\Finance\ModuleSetting::allows('online_forms') && \App\Models\Finance\ModuleSetting::allows($key); $frontendSectionVisible = fn ($key) => \App\Support\VisibilitySettings::isFrontendSectionVisible($key); $heroPrimaryUrl = $homeUrl($websiteSettings['home_hero_primary_button_url'] ?? null, route('front.apply.create')); if (! $publicFormVisible('public_form_online_apply') && $heroPrimaryUrl === route('front.apply.create')) { $heroPrimaryUrl = route('front.programs.index'); } $heroSecondaryUrl = $homeUrl($websiteSettings['home_hero_secondary_button_url'] ?? null, route('front.programs.index')); $statsCards = [ ['label' => 'Faculties', 'value' => $stats['faculties'] ?? 0, 'icon' => 'fa-landmark', 'href' => route('front.faculties.index'), 'tone' => 'emerald'], ['label' => 'Departments', 'value' => \Illuminate\Support\Facades\Schema::hasTable('departments') ? \App\Models\Department::count() : 0, 'icon' => 'fa-diagram-project', 'href' => route('front.departments.index'), 'tone' => 'sky'], ['label' => 'Courses', 'value' => $stats['courses'] ?? 0, 'icon' => 'fa-book-open', 'href' => route('front.courses.index'), 'tone' => 'amber'], ['label' => 'Enrolled Students', 'value' => $stats['enrollments'] ?? ($stats['students'] ?? 0), 'icon' => 'fa-user-graduate', 'href' => route('front.programs.index'), 'tone' => 'rose'], ]; $formLinks = [ ['module' => 'public_form_online_apply', 'label' => 'Online Apply', 'note' => 'Admission form', 'icon' => 'fa-file-signature', 'href' => route('front.apply.create')], ['module' => 'public_form_admission_track', 'label' => 'Track Admission', 'note' => 'Check application status', 'icon' => 'fa-clipboard-check', 'href' => route('front.admission.track')], ['module' => 'public_form_membership', 'label' => 'Membership', 'note' => 'Join the community', 'icon' => 'fa-id-card', 'href' => route('front.membership.create')], ['module' => 'public_form_volunteer_lecturer', 'label' => 'Volunteer Lecturer', 'note' => 'Teach and mentor', 'icon' => 'fa-chalkboard-user', 'href' => route('front.volunteer.create')], ['module' => 'public_form_volunteer_staff', 'label' => 'Volunteer Staff', 'note' => 'Administrative support', 'icon' => 'fa-people-carry-box', 'href' => route('front.volunteer_staff.create')], ['module' => 'public_form_donation', 'label' => 'Donation', 'note' => 'Support students', 'icon' => 'fa-hand-holding-heart', 'href' => route('front.donation.create')], ['module' => 'public_form_contact', 'label' => 'Contact Form', 'note' => 'Send a message', 'icon' => 'fa-envelope', 'href' => route('front.contact')], ]; $formLinks = collect($formLinks)->filter(fn ($link) => $publicFormVisible($link['module']))->values(); @endphp @section('body')
@if($frontendSectionVisible('hero') || $frontendSectionVisible('learning_panel'))
@if($frontendSectionVisible('hero'))
{{ $websiteSettings['home_hero_kicker'] ?? 'Free education for Afghan learners' }}

{{ $websiteSettings['home_hero_title'] ?? 'Knowledge has no borders, no barriers.' }}

{{ $websiteSettings['home_hero_description'] ?? 'Afghan Online Education brings accessible, high-quality education to learners across Afghanistan and the diaspora through modern online programs, courses, and digital services.' }}

@endif @if($frontendSectionVisible('learning_panel'))
Afghan Online Education
{{ $websiteSettings['home_hero_panel_label'] ?? 'Professional online learning' }}

{{ number_format($stats['programs'] ?? 0) }} programs, one connected academic gateway

{{ $websiteSettings['home_hero_panel_text'] ?? 'Modern courses, academic programs, student and teacher portals, admissions, digital resources, and public services designed for Afghan learners everywhere.' }}

@endif
@endif @if($frontendSectionVisible('academic_counts'))
{{ $websiteSettings['home_counts_kicker'] ?? 'Academic counts' }}

{{ $websiteSettings['home_counts_title'] ?? 'Explore the institution by numbers' }}

@foreach($statsCards as $card) {{ number_format($card['value']) }} {{ $card['label'] }} @endforeach
@endif @if($frontendSectionVisible('mission_strip'))

“{{ $pageSummary($mission, 'Education is the most powerful pathway to rebuild communities, create opportunity, and give every Afghan learner a stronger future.', 260) }}”

Afghan Online Education — Mission
@endif @if($frontendSectionVisible('story_cards'))
@endif @if($frontendSectionVisible('about_band'))
{{ $websiteSettings['home_about_kicker'] ?? 'About us' }}

{{ $websiteSettings['home_about_title'] ?? 'Leadership for open, accountable, and modern learning' }}

{{ $websiteSettings['home_about_description'] ?? 'Our commitment is to make education reachable, organized, and useful for every learner who trusts this institution with their future.' }}

{{ $websiteSettings['home_about_button_text'] ?? 'Read about us' }}
@endif @if($frontendSectionVisible('latest_updates'))
{{ $websiteSettings['home_latest_kicker'] ?? 'Latest updates' }}

{{ $websiteSettings['home_latest_title'] ?? 'Posts and events' }}

@forelse($posts as $post) @php $postImage = $post->cover_image ? asset('storage/' . $post->cover_image) : $heroBackground; @endphp {{ $post->title }}
{{ optional($post->published_at ?? $post->created_at)->format('M d, Y') }} {{ $post->title }} {{ \Illuminate\Support\Str::limit(strip_tags($post->body ?? ''), 96) ?: 'Read the latest announcement from Afghan Online Education.' }}
@empty
Latest posts will appear after publishing.
@endforelse
@forelse($events as $event)
{{ optional($event->published_at ?? $event->created_at)->format('M d, Y') }} {{ $event->title }}
@empty
Events will appear after publishing.
@endforelse
@endif @if($frontendSectionVisible('community_stories'))
{{ $websiteSettings['home_testimonials_kicker'] ?? 'Stories' }}

{{ $websiteSettings['home_testimonials_title'] ?? 'Student, teacher, alumni, and partner stories' }}

Students Teachers Alumni Partners

Community voices

@forelse($testimonials->take(4) as $testimonial) @php $testimonialPhoto = $testimonial->photo ? asset('storage/' . $testimonial->photo) : null; @endphp
@if($testimonialPhoto) {{ $testimonial->name }} @else {{ \Illuminate\Support\Str::upper(\Illuminate\Support\Str::substr($testimonial->name, 0, 1)) }} @endif
{{ $testimonial->name }} {{ $testimonial->role_or_program ?? ucfirst($testimonial->audience_type) }}

{{ \Illuminate\Support\Str::limit($testimonial->quote, 118) }}

@empty
Testimonials will appear after publishing.
@endforelse

Recognition and partners

@forelse($accreditations->take(3) as $item) @if($item->cover_image) {{ $item->title }} @else @endif {{ $item->title }} @empty
Accreditation logos can be added from Website Content Items.
@endforelse
@forelse($partners->take(4) as $item) {{ $item->title }} @empty Partner profiles can be added from Website Content Items. @endforelse
@forelse($successStories->take(3) as $item) {{ $item->title }} {{ \Illuminate\Support\Str::limit($item->summary ?: strip_tags($item->body), 72) }} @empty
Success stories can be added from Website Content Items.
@endforelse
@endif @if($frontendSectionVisible('team'))
{{ $websiteSettings['home_team_kicker'] ?? 'HR team' }}

{{ $websiteSettings['home_team_title'] ?? 'People behind the institution' }}

Full team
@forelse($teamMembers as $member) @php $memberPhoto = $member->photo ? asset('storage/' . $member->photo) : null; @endphp @if($memberPhoto) {{ $member->name }} @else
{{ \Illuminate\Support\Str::upper(\Illuminate\Support\Str::substr($member->name, 0, 1)) }}
@endif {{ \Illuminate\Support\Str::headline($member->team_group) }} {{ $member->name }} {{ $member->position ?? $member->department ?? 'Team member' }}
@empty
HR team profiles will appear after publishing.
@endforelse
@endif @if($frontendSectionVisible('social_portals'))
{{ $websiteSettings['home_social_kicker'] ?? 'Social media' }}

{{ $websiteSettings['home_social_title'] ?? 'Follow official updates' }}

{{ $websiteSettings['home_social_description'] ?? 'Announcements, events, admissions news, and student communication are connected through the official public channels.' }}

Portals
@endif @if($frontendSectionVisible('forms') && $formLinks->count())
{{ $websiteSettings['home_forms_kicker'] ?? 'Forms place' }}

{{ $websiteSettings['home_forms_title'] ?? 'Forms and public services' }}

@foreach($formLinks as $link) {{ $link['label'] }} {{ $link['note'] }} @endforeach
@endif
@endsection