So I have been playing around with the structure of a new comment system for my blog using Polymorphic relationships. It all works fine but I am having trouble sorting the comments.
For example, here I get what I need through the controller and pass to the view.
$post = BlogPosts::with('BlogCategories', 'Users', 'BlogTags', 'Comments')
->where('slug', $slug)
->first();
return view('blog.show', compact('post'));
All that works fine and returns the blog post with the various relations, including the comments.
What I am struggling with is that I want to sort the result so that the comments attached to the post are displayed in descending order.