Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

get popular posts on laravel

$posts = Post::withCount('comments','likes')->orderBy(DB::raw('comments_count + likes_count'),'DESC')->get();
Source by laravel-news.com #
 
PREVIOUS NEXT
Tagged: #popular #posts #laravel
ADD COMMENT
Topic
Name
5+9 =