@extends('public.layout.app') @section('title', $material->title) @section('body')
@include('public.portals.teacher.partials.nav')

{{ $material->title }}

{{ $material->course->title }} ({{ $material->course->code }})

{{ __('front.material_details') }}
{{ __('front.type') }} @if($material->type == 'video') {{ __('front.video') }} @else {{ __('front.document') }} @endif
{{ __('front.uploaded_by') }} {{ $material->uploader->name ?? '—' }}
{{ __('front.uploaded_at') }} {{ $material->created_at->format('M d, Y h:i A') }}
{{ __('front.last_updated') }} {{ $material->updated_at->format('M d, Y h:i A') }}
@if($material->type == 'video') Video Preview @else Document Preview @endif
@if($material->type == 'video' && $material->video_url)
@elseif($material->file_path && Storage::disk('public')->exists($material->file_path)) @php $extension = pathinfo($material->file_path, PATHINFO_EXTENSION); $isImage = in_array(strtolower($extension), ['jpg','jpeg','png','gif','webp']); $isPdf = strtolower($extension) == 'pdf'; @endphp @if($isImage)
{{ $material->title }}
@elseif($isPdf)
@else

{{ __('front.preview_not_available_for_this_file_type') }}

@endif @else

{{ __('front.file_not_found_or_unavailable') }}

@endif
@endsection