Sort by Post Likes
Hi,
I have the Ninja Media Script and I want to sort by Post-Likes, so whoever gets the most votes becomes the top?
What I'd like to do, is be able to break it down by day Monday and rank the top rated etc
Can anyone help?
Ordering should be easy, you should be able to find the model used in the controller and there you would add something like this:
->orderByRaw('SELECT count(*) FROM postsOrLikes WHERE item_id = items.id')
Or something like that, it should get you started. However, not sure the exact models, controllers or table names.