@extends('layouts.app') @section('content')
@if($sidebarSubjects->count() > 1)
@endif
{{-- Thinner gutter on mobile --}} @forelse($course->chapters as $index => $chapter)
@php $coursePurchased = auth()->user()->hasPurchased($course) || auth()->user()->isAdmin(); $chapterPurchased = $coursePurchased || auth()->user()->hasPurchased($chapter); @endphp
@if(!$chapterPurchased)
Elite Access Only
@endif
MODULE {{ $index + 1 }}
{{ $chapter->name }}
@if($chapter->description)

{{ $chapter->description }}

@else

Explore high-definition modules

@endif
{{ number_format($chapter->ratings()->avg('rating') ?: 0, 1) }}
@if(!$chapterPurchased)
@if($chapter->discount_price > 0)
${{ number_format($chapter->price, 2) }}
${{ number_format($chapter->discount_price, 2) }}
@else
${{ number_format($chapter->price, 2) }}
@endif
@endif
@if($chapterPurchased) Open Module @else
View Curriculum @if(auth()->user()->isInCart($chapter)) In Cart @else
@csrf
@endif
@endif
@empty

No modules found for this course

Check back later or browse other courses.

@endforelse
@endsection