Level 6
->withCount(['likes','views'])
->orderByRaw('likes_count + views_count DESC')
->get();
2 likes
Hi, I have relation of a post where I'm getting likes_count and views_count from eloquent query builder using ```
->withCount(['likes','views']);
How I can get order by list of sum of both likes_count + views_count ?
->withCount(['likes','views'])
->orderByRaw('likes_count + views_count DESC')
->get();
Please or to participate in this conversation.