@extends('frontend.layouts.app') @section('title', 'Testimonials') @php use App\Helpers\Helper; @endphp @section('content') {{-- Hero Section --}} @include('frontend.partials.hero', [ 'mainHeading' => Helper::contentText('pages.testimonials'), 'subHeading' => Helper::contentText('pages.testimonials_sub_heading'), 'breadcrumb1' => [ 'name' => __('route.home'), 'route' => route('home'), ], 'breadcrumb2' => [ 'name' => __('pages.testimonials'), 'route' => route('testimonials'), 'class' => 'text-gray-400', ], 'breadcrumb3' => null, 'breadcrumb4' => null, ]) {{-- Testimonials Section --}}
@php $testimonialSections = [ [ 'type' => 'alumni', 'data' => $alumniTestimonials, 'label' => Helper::content('pages.alumni_testimonial_label'), 'title' => Helper::content('pages.alumni_testimonial_title'), 'subtitle' => Helper::content('pages.alumni_testimonial_subtitle'), 'bg' => 'bg-[#F2F5FA]', 'bg_image' => 'assets/frontend/images/about-us/white-bg.avif', 'gradient' => 'bg-gradient-to-b from-white/60 to-white/40', ], [ 'type' => 'guardian', 'data' => $guardianTestimonials, 'label' => Helper::content('pages.guardian_testimonial_label'), 'title' => Helper::content('pages.guardian_testimonial_title'), 'subtitle' => Helper::content('pages.guardian_testimonial_subtitle'), 'bg' => 'text-[#F2F5FA]', 'bg_image' => 'assets/frontend/images/about-us/hero-section.jpg', 'gradient' => 'bg-gradient-to-b from-black/60 to-black/40', ], [ 'type' => 'faculty', 'data' => $facultyTestimonials, 'label' => Helper::content('pages.faculty_testimonial_label'), 'title' => Helper::content('pages.faculty_testimonial_title'), 'subtitle' => Helper::content('pages.faculty_testimonial_subtitle'), 'bg' => 'bg-[#F2F5FA]', 'bg_image' => 'assets/frontend/images/about-us/white-bg.avif', 'gradient' => 'bg-gradient-to-b from-white/60 to-white/40', ], ]; // Every testimonial in one list, tagged with its group, so the page shows them all at once $groups = [ 'alumni' => [$alumniTestimonials, __('pages.alumni')], 'guardian' => [$guardianTestimonials, __('pages.guardian')], 'faculty' => [$facultyTestimonials, __('pages.faculty')], ]; $items = collect(); foreach ($groups as $key => [$list, $label]) { foreach ($list as $item) { $items->push(['key' => $key, 'label' => $label, 'model' => $item]); } } $counts = $items->groupBy('key')->map->count(); use App\Enum\PerspectiveFromEnum; @endphp
@if ($items->isEmpty())

{{ __('pages.no_details') }}

@else {{-- Filter --}}
@foreach ($groups as $key => [$list, $label]) @continue(!($counts[$key] ?? 0)) @endforeach
{{-- All testimonials, no sliding --}}
@foreach ($items as $row) @php $testimonial = $row['model']; $role = $row['key'] === 'alumni' ? trim(__('pages.batch_of') . ' ' . optional($testimonial->alumni)->batch) : PerspectiveFromEnum::map($testimonial->perspective_from); @endphp
{!! Helper::stripInlineStyle($testimonial->testimonial_text) !!}

{{ $testimonial->full_name }}

{{ $role }}

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