@forelse ($courses as $course) @php $playlists = json_decode($course->playlist); @endphp
@php $course_thumbnail = getCourseImg($course->thumbnail); @endphp
{{ $course->level }} {!! courseLevelHTML($course->level) !!}

{{ $course->title }}

@if ($course->before_price) {{ amountCurrency($course->before_price) }} @endif {{ amountCurrency($course->price) }}

{{ getRateAndReviews($course->id)["rate"] }}

{{ \App\Models\PayedCourseLog::where("course_id",$course->id)->count() }} Student

{{ count($playlists ?? []) + 1 }} Modules

@php $playlistDuration = getVideosDuration( collect($playlists ?? [])->map(function ($pl_) { return $pl_->path; }), ); @endphp

{{ date('H', $playlistDuration) }}h {{ date('i', $playlistDuration) }}m {{ date('s', $playlistDuration) }}s

@empty

You don't have any course {{ $page ? $page : 'active' }} yet

@endforelse