@php $review = App\Models\Review::where('course_id', $bootcamp->id) ->orderBy('id', 'DESC') ->get(); $total = $review->count(); $rating = array_sum(array_column($review->toArray(), 'rating')); $average_rating = 0; if ($total != 0) { $average_rating = $rating / $total; } @endphp
course-thumbnail

@if ($bootcamp->is_paid == 0) {{ get_phrase('Free') }} @else @if ($bootcamp->discount_flag == 1) @php $discounted_price = number_format(($bootcamp->price - $bootcamp->discounted_price), 2) @endphp {{ currency($discounted_price) }} {{ currency($bootcamp->price, 2) }} @else {{ currency($bootcamp->price, 2) }} @endif @endif

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

  • {{ date('d-M-Y', $bootcamp->publish_date) }}
  • {{ count_bootcamp_classes($bootcamp->id) }} {{ get_phrase('Class') }}
{{ get_phrase('View Details') }} @php $btn['url'] = route('purchase.bootcamp', $bootcamp->id); $btn['title'] = get_phrase($bootcamp->is_paid ? 'Buy Now' : 'Enroll Now'); if (isset(auth()->user()->id)) { $my_bootcamp = App\Models\BootcampPurchase::where('user_id', auth()->user()->id) ->where('bootcamp_id', $bootcamp->id) ->where('status', 1) ->first(); if ($my_bootcamp) { $btn['title'] = get_phrase('In Collection'); $btn['url'] = route('my.bootcamp.details', $bootcamp->slug); } $pending_payment = DB::table('offline_payments') ->where('user_id', auth()->user()->id) ->where('item_type', 'bootcamp') ->where('items', $bootcamp->id) ->where('status', 0) ->first(); if ($pending_payment) { $btn['title'] = get_phrase('Processing'); $btn['url'] = 'javascript:void(0);'; } } @endphp {{ $btn['title'] }}