@extends('web.layouts.layout') @section('meta_title', $courses->meta_title ?? 'About Online Course') @section('meta_description', $courses->meta_description ?? '') @section('meta_keywords', $courses->meta_keywords ?? '') @section('content') @php $instructers = DB::table('instructors')->whereIn('id', explode(',',$courses->instructor_id??0))->get(); $services = DB::table('services')->where('id', $courses->service_id)->first(); $reviews = DB::table('course_reviews')->where('course_id', $courses->id)->where('status',1)->orderby('sequence')->get(); $students_count = DB::table('students')->where('course_id', $courses->id)->count(); //$instructer_course = $instructer ? DB::table('courses')->where('instructor_id', $instructer->id)->count() : 0; @endphp @if(!empty($courses->title) || !empty($courses->short_title))

{{$courses->title??''}}

Home {{$courses->short_title??''}}
@endif
@if(!empty($courses->title) || $reviews->isNotEmpty())

{{$courses->title??''}}

@php $totalReviews = $reviews->count(); $averageRating = $totalReviews > 0 ? round($reviews->avg('rating'), 1) : 0; $fullStars = floor($averageRating); $halfStar = ($averageRating - $fullStars) >= 0.5; $emptyStars = 5 - ceil($averageRating); @endphp @if($totalReviews > 0)
    @for ($i = 0; $i < $fullStars; $i++)
  • @endfor @if ($halfStar)
  • @endif @for ($i = 0; $i < $emptyStars; $i++)
  • @endfor
({{ number_format($totalReviews) }} reviews)
@endif
@endif @if(!empty($courses->description))

Description

{!!$courses->description??''!!}

@endif @if(!empty($courses->about_the_course))

About The Course

{!!$courses->about_the_course??''!!}

@endif @if(!empty($courses->objectives_of_the_Course))

Objectives of the Course

{!!$courses->objectives_of_the_Course??''!!}

@endif @if(!empty($courses->who_is_this_course_for))

Requirements

{!!$courses->who_is_this_course_for??''!!}
@endif @if($instructers)
@foreach($instructers as $instructer ) @php $instructer_course = $instructer ? DB::table('courses')->where('instructor_id', $instructer->id)->count() : 0; @endphp

Instructors

Instructor image
{{$instructer->name??''}}
@if(!empty($instructer->designation)) {{$instructer->designation??''}} @endif
@if($instructer_course > 0)
{{$instructer_course}} Courses
@endif @if($students_count > 0)
{{$students_count}} Students
@endif
@if(!empty($instructer->facebook_link) || !empty($instructer->x_link) || !empty($instructer->linkedin_link) || !empty($instructer->instagram_link) || !empty($instructer->behance_link))
@endif
@if(!empty($instructer->description))

{!!$instructer->description??''!!}

@endif
@endforeach
@endif @if($reviews->isNotEmpty())

Student Feedback

@php $totalReviews = $reviews->count(); $averageRating = $totalReviews > 0 ? round($reviews->avg('rating'), 1) : 0; $starCounts = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0]; foreach ($reviews as $review) { $rating = (int) $review->rating; if ($rating >= 1 && $rating <= 5) { $starCounts[$rating]++; } } $starColors = [ 5 => 'bg-success', 4 => 'bg-primary', 3 => 'bg-warning', 2 => 'bg-orange', 1 => 'bg-danger', ]; @endphp
{{ $averageRating }}
@for ($i = 1; $i <= 5; $i++) @if ($i <= floor($averageRating)) @elseif ($i == ceil($averageRating) && ($averageRating - floor($averageRating)) >= 0.5) @else @endif @endfor
({{ number_format($totalReviews) }} Reviews)
@for ($star = 5; $star >= 1; $star--) @php $count = $starCounts[$star]; $percent = $totalReviews > 0 ? round(($count / $totalReviews) * 100) : 0; $barClass = $starColors[$star] ?? 'bg-secondary'; @endphp
{{ $star }}
{{ $percent }}% {{ $count }}
@endfor
@endif

Reviews

@forelse($reviews as $review)
@if(!empty($review->image))
image
@endif
@php $rating = (int) $review->rating; @endphp @for ($i = 1; $i <= 5; $i++) @endfor
{{ $review->name ?? 'Anonymous' }}
@if(!empty($review->description))

{!! $review->description ?? '' !!}

@endif
@empty

No reviews yet. Be the first to review this course!

@endforelse
@include('web.pages.sign_up')