fixd bug & added approved comment

pull/49/head
A1Gard 5 months ago
parent 1733b9c1c1
commit 14cc7005dd

@ -51,4 +51,15 @@ class Clip extends Model
return route('');
}
public function comments()
{
return $this->morphMany(Comment::class, 'commentable');
}
public function approvedComments()
{
return $this->morphMany(Comment::class, 'commentable')->where('status', 1);
}
}

@ -74,4 +74,15 @@ class Gallery extends Model implements HasMedia
return '#';// WIP
return route('');
}
public function comments()
{
return $this->morphMany(Comment::class, 'commentable');
}
public function approvedComments()
{
return $this->morphMany(Comment::class, 'commentable')->where('status', 1);
}
}

@ -98,7 +98,7 @@ class Post extends Model implements HasMedia
public function approvedComments()
{
return $this->morphMany(Comment::class, 'commentable')->where('status', 1);
return $this->morphMany(Comment::class, 'commentable');
}
public function mainGroup(){
@ -110,6 +110,8 @@ class Post extends Model implements HasMedia
}
// public function toArray()
// {
// return [

@ -106,7 +106,7 @@ class Product extends Model implements HasMedia
public function approvedComments()
{
return $this->morphMany(Comment::class, 'commentable')->where('status', 1)->whereNull('sub_comment_id');
return $this->morphMany(Comment::class, 'commentable')->where('status', 1);
}
public function categories()

Loading…
Cancel
Save