Пример #1
0
 public static function add($body, $authorable, $commentable, $parentId = 0, $status = 'show')
 {
     $comment = new Comment();
     $comment->body = $body;
     $comment->authorable_id = $authorable->id;
     $comment->authorable_type = get_class($authorable);
     $comment->commentable_id = $commentable->id;
     $comment->commentable_type = get_class($commentable);
     $comment->parent_id = $parentId;
     $comment->status = $status;
     $comment->save();
     return $comment;
 }
Пример #2
0
 public function addComment($body, $commentable, $parentId = 0, $status = 'show')
 {
     return Comment::add($body, $this, $commentable, $parentId, $status);
 }