@php $chapterEdit = 'chapter.edit'; $chapterDelete = 'chapter.destroy'; $topicDelete = 'topic.destroy'; if (isInstructor()) { $chapterEdit = 'instructor.chapter.edit'; $chapterDelete = 'instructor.chapter.destroy'; $topicDelete = 'instructor.topic.destroy'; } elseif (isOrganization()) { $chapterEdit = 'organization.chapter.edit'; $chapterDelete = 'organization.chapter.destroy'; $topicDelete = 'organization.topic.destroy'; } @endphp @if (isset($course, $course->chapters) && !empty($course->chapters))
@foreach ($course->chapters as $key => $chapter)
{{ $chapter->title }}
    @foreach ($chapter->topics as $topic) @if ($topic?->topicable?->topic_type?->slug == 'reading')
  • {{ ucfirst($topic?->topicable?->topic_type?->slug) }} :
    {{ $topic?->topicable?->title }}
  • @endif @if ($topic?->topicable?->topic_type?->slug == 'supplement')
  • {{ ucfirst($topic?->topicable?->topic_type?->slug) }} :
    {{ $topic?->topicable?->title }}
  • @endif @if ($topic?->topicable?->topic_type?->slug == 'assignment')
  • {{ ucfirst($topic?->topicable?->topic_type?->slug) }} :
    {{ $topic?->topicable?->title }}
  • @endif @if ($topic?->topicable?->topic_type?->slug == 'video')
  • {{ ucfirst($topic?->topicable?->topic_type?->slug) }} :
    {{ $topic?->topicable?->title }}
  • @endif @if ($topic?->topicable?->topic_type?->slug == 'quiz')
  • {{ ucfirst($topic?->topicable?->topic_type?->slug) }} :
    {{ $topic?->topicable?->title }}
  • @endif @endforeach
@endforeach
@endif