I'm trying to sort by the newest messages first, including the sub-messages. For example, if someone adds a sub-comment to an old message at the bottom, it would be moved to the top.
Here is the code I'm using:
$comments = Comment::where('discussion_id' , $info['id'])->where('parent_id', 0)->orderby('id' , 'desc')->paginate(6);
if parent_id is 0, it is not a sub-comment.