소스 검색

Update TimelineController

Daniel Supernault 7 년 전
부모
커밋
5f13428197
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      app/Http/Controllers/TimelineController.php

+ 2 - 0
app/Http/Controllers/TimelineController.php

@@ -20,6 +20,7 @@ class TimelineController extends Controller
       $following->push(Auth::user()->profile->id);
       $timeline = Status::whereIn('profile_id', $following)
                   ->orderBy('id','desc')
+                  ->withCount(['comments', 'likes'])
                   ->simplePaginate(20);
       $type = 'personal';
       return view('timeline.template', compact('timeline', 'type'));
@@ -31,6 +32,7 @@ class TimelineController extends Controller
       // $timeline = Timeline::build()->local();
       $timeline = Status::whereHas('media')
                   ->whereNull('in_reply_to_id')
+                  ->withCount(['comments', 'likes'])
                   ->orderBy('id','desc')
                   ->simplePaginate(20);
       $type = 'local';