@extends('layouts.default') @push('title', get_phrase('My courses')) @push('meta')@endpush @push('css')@endpush @section('content')
@include('frontend.default.student.left_sidebar')

{{ get_phrase('My Courses') }}

@foreach ($my_courses as $course) @php $course_progress = progress_bar($course->course_id); @endphp
course-thumbnail
author-image
{{ $course->user_name }}

{{ ucfirst($course->title) }}

{{ get_phrase('Progress') }}

{{ $course_progress }}%

@if($course->expiry_date > 0 && $course->expiry_date < time())
{{ get_phrase('Expired') }}:
{{ date('d M Y, H:i A', $course->expiry_date) }}
@else @if($course->expiry_date == 0)
{{ get_phrase('Expiry period') }}:
{{ get_phrase('Lifetime Access') }}
@else
{{ get_phrase('Expiration On') }}:
{{ date('d M Y, H:i A', $course->expiry_date) }}
@endif @endif
@php $watch_history = App\Models\Watch_history::where('course_id', $course->course_id) ->where('student_id', auth()->user()->id) ->first(); $lesson = App\Models\Lesson::where('course_id', $course->course_id) ->orderBy('sort', 'asc') ->first(); if (!$watch_history && !$lesson) { $url = route('course.player', ['slug' => $course->slug]); } else { if ($watch_history) { $lesson_id = $watch_history->watching_lesson_id; } elseif ($lesson) { $lesson_id = $lesson->id; } $url = route('course.player', ['slug' => $course->slug, 'id' => $lesson_id]); } @endphp @if($course->expiry_date > 0 && $course->expiry_date < time()) {{ get_phrase('Renew') }} @else @if ($course_progress > 0 && $course_progress < 100.00) {{ get_phrase('Continue') }} @elseif ($course_progress == 100.00) {{ get_phrase('Watch again') }} @else {{ get_phrase('Start Now') }} @endif @endif
@endforeach @if ($my_courses->count() == 0)
@include('frontend.default.empty')
@endif
@if (count($my_courses) > 0)
@endif
@endsection @push('js') @endpush