?
Current File : /home/sanghavirealty/public_html/resourcesazwer/views/testimonials/testimonial-grid.blade.php
<section class="testimonial-start">


    <div class="container">
        <div class="testi-title text-center">
            <h5 class="text-center">Testimonial</h5>
        </div>
        <h2 class="text-center"> Our Happy Clients </h2>
        <div id="testimonialCarousel" class="carousel slide testimonial-carousel" data-bs-ride="carousel">
            <div class="carousel-indicators">
                <button type="button" data-bs-target="#testimonialCarousel" data-bs-slide-to="0" class="active"
                    aria-current="true" aria-label="Slide 1"></button>
                <button type="button" data-bs-target="#testimonialCarousel" data-bs-slide-to="1"
                    aria-label="Slide 2"></button>
                <button type="button" data-bs-target="#testimonialCarousel" data-bs-slide-to="2"
                    aria-label="Slide 3"></button>
            </div>
            <div class="carousel-inner mt-5">


                @foreach ($testimonials as $customer)
                    <div class="carousel-item {{ $loop->first ? 'active' : '' }}">
                        <div class="testimonial-card1 card fade-in text-center">


                            <div class="img-wrapper">
                                <img src="{{ $customer->avatar_path ? asset('storage/' . $customer->avatar_path) : asset('userassets/user2.jpg') }}"
                                    class="d-block" alt="{{ $customer->name }}'s avatar" style="width: 120px">
                            </div>
                            <div class="testi-cont d-flex justify-content-between gap-5">
                                <div class="customer-content">
                                    <p>"{{ $customer->content }}"</p>

                                </div>
                                <div class="customer-name">
                                    <h4 class="mb-1">{{ $customer->name }}</h4>
                                    <h6>{{ $customer->position }}, {{ $customer->company }}</h6>
                                    <div class="review-star-icon fs-13 lh-20">
                                        @for ($i = 0; $i < $customer->rating; $i++)
                                            <i class="bi bi-star-fill"></i>
                                        @endfor
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                @endforeach





            </div>

        </div>
    </div>

    <script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CollectionPage",
  "name": "Customer Testimonials",
  "mainEntity": [
    @php
      $totalRating = 0;
      $reviewCount = count($testimonials);
    @endphp
    @foreach($testimonials as $index => $customer)
    {
      "@type": "Review",
      "author": {
        "@type": "Person",
        "name": "{{ $customer->name }}"
      },
      "reviewRating": {
        "@type": "Rating",
        "ratingValue": "{{ $customer->rating }}",
        "bestRating": "5"
      },
      "itemReviewed": {
        "@type": "Organization",
        "name": "Face Investigations"
      },
      "reviewBody": "{{ $customer->content }}"
    }{{ $index < $reviewCount - 1 ? ',' : '' }}
    @php
      $totalRating += $customer->rating;
    @endphp
    @endforeach
  ],
  @if($reviewCount > 0)
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ number_format($totalRating / $reviewCount, 1) }}",
    "reviewCount": "{{ $reviewCount }}"
  }
  @endif
}
</script>

</section>