@extends('student.layouts.app') @section('styles') @endsection @section('title', __('dashboard.Materials') ) @section('content') @php $isArabic = app()->getLocale() === 'ar'; $mediaType = determineFileType($material->type); $supportsResume = in_array($mediaType, ['video', 'audio'], true); $typeLabels = [ 'image' => $isArabic ? 'صورة تعليمية' : 'Image', 'video' => $isArabic ? 'فيديو' : 'Video', 'audio' => $isArabic ? 'ملف صوتي' : 'Audio', 'pdf' => $isArabic ? 'ملف PDF' : 'PDF', 'file' => $isArabic ? 'ملف' : 'File', ]; $materialTypeLabel = $typeLabels[$mediaType] ?? ($isArabic ? 'محتوى تعليمي' : 'Learning content'); $materialDescription = filled($material->description) ? $material->description : ($isArabic ? 'تم تجهيز هذه المادة ضمن المقرر لتكمل متابعة الدرس الحالي.' : 'This material is available as part of the current lesson.'); $currentMaterialIndex = $courseMaterials->search(fn ($item) => (int) $item->id === (int) $material->id); $previousMaterial = $currentMaterialIndex !== false && $currentMaterialIndex > 0 ? $courseMaterials[$currentMaterialIndex - 1] : null; $nextMaterial = $currentMaterialIndex !== false && $currentMaterialIndex < ($courseMaterials->count() - 1) ? $courseMaterials[$currentMaterialIndex + 1] : null; $currentPosition = $currentMaterialIndex !== false ? $currentMaterialIndex + 1 : 1; $materialCount = $courseMaterials->count(); $downloadUrl = \Illuminate\Support\Facades\Storage::url($material->material); @endphp
{{ $materialDescription }}