So, I have a situation where users can add posts to a forum and then comment on those posts.
What I want to achieve here is pulling in all forum posts within the past 24 hours, but I only want the posts that have the most messages (let's say max 5 records). I would like to order by those message counts as well.
I have relationships set up between the the two models already.
ForumPosts hasMany('Comments');
Comments belongsTo('ForumPosts');
Any thoughts as to what I could do?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community