actuallymab / laravel-comment

Just another comment system for your awesome Laravel project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get Approved Comments List Function

MehmetNuri opened this issue · comments

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;

    }