Get Approved Comments List Function
MehmetNuri opened this issue · comments
Mehmet Nuri ÖZTÜRK commented
Open Commentable.php file and add this code
public function approvedComments()
{
return $this->comments()->where('approved', true);
}
Usage:
public function post()
{
$user = User::find(1);
$product = Post::find(1);
return $product->notApprovedComments;
}