Owl\Repositories\Eloquent\CommentRepository::createComment PHP Метод

createComment() публичный Метод

Create a new comment.
public createComment ( $cmt ) : Illuminate\Database\Eloquent\Model
Результат Illuminate\Database\Eloquent\Model
    public function createComment($cmt)
    {
        $comment = $this->comment->newInstance();
        $comment->item_id = $cmt->item_id;
        $comment->user_id = $cmt->user_id;
        $comment->body = $cmt->body;
        $comment->save();
        $comment->user->username = $cmt->username;
        $comment->user->email = $cmt->email;
        return $comment;
    }