2 parents e368bcd + 20c5ee7 commit add31edCopy full SHA for add31ed
1 file changed
app/Models/Comment.php
@@ -98,10 +98,18 @@ public function getCommentableUrl()
98
99
if ($this->commentable_type == "App\Models\Lesson") {
100
$lesson = $this->commentable;
101
- $workshop = $lesson->lessonable;
+ $lessonable = $lesson->lessonable;
102
$lessonSlug = $lesson->slug;
103
104
- return '/workshops/'.$workshop->slug.'/'.$lessonSlug;
+ // Check if the lesson belongs to a Challenge (mini-projeto)
105
+ if ($lessonable instanceof \App\Models\Challenge) {
106
+ return '/mini-projetos/'.$lessonable->slug.'/resolucao/'.$lessonSlug;
107
+ }
108
+
109
+ // Check if the lesson belongs to a Workshop
110
+ if ($lessonable instanceof \App\Models\Workshop) {
111
+ return '/workshops/'.$lessonable->slug.'/'.$lessonSlug;
112
113
}
114
115
0 commit comments