Skip to content

Commit 51cd7b1

Browse files
committed
fix: course page
1 parent 96f80be commit 51cd7b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Traits/IsPurchased.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public function isPurchased(?int $userId = null) {
1010
$userId = auth()->id();
1111
}
1212

13-
return $this->morphMany(Purchase::class, 'purchasable')->where('user_id', $userId)->where('approved', 1)->first();
13+
return $this->morphMany(Purchase::class, 'purchasable')->where('user_id', $userId)->where('approved', 1);
1414
}
1515
}

resources/views/frontend/pages/myCourses.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class="d-flex align-items-start gap-2 text-reset">
3737
@endphp
3838
<td>
3939
@if ($video)
40-
@if ($course->isPurchased())
40+
@if ($course->isPurchased)
4141
<x-backend.ui.button type="custom" class="btn-sm text-capitalize btn-dark"
4242
href="{{ route('course.videos', $course->id) . '?videos_id=' . $video->id }}">
4343
Lessons

0 commit comments

Comments
 (0)