From 197829224eaa8f632d574a7fcf88777ad9bee9d1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 11 Sep 2018 20:55:19 -0600 Subject: [PATCH] Update timeline logic to sort by date instead of id --- app/Http/Controllers/SiteController.php | 2 +- app/Http/Controllers/TimelineController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index 0a38f30b..7c168315 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -43,7 +43,7 @@ class SiteController extends Controller ->whereNotIn('profile_id', $filtered) ->whereHas('media') ->whereVisibility('public') - ->orderBy('id', 'desc') + ->orderBy('created_at', 'desc') ->withCount(['comments', 'likes', 'shares']) ->simplePaginate(20); $type = 'personal'; diff --git a/app/Http/Controllers/TimelineController.php b/app/Http/Controllers/TimelineController.php index 77b64b3b..1ce714b9 100644 --- a/app/Http/Controllers/TimelineController.php +++ b/app/Http/Controllers/TimelineController.php @@ -28,7 +28,7 @@ class TimelineController extends Controller ->pluck('filterable_id'); $timeline = Status::whereIn('profile_id', $following) ->whereNotIn('profile_id', $filtered) - ->orderBy('id', 'desc') + ->orderBy('created_at', 'desc') ->withCount(['comments', 'likes']) ->simplePaginate(20); $type = 'personal'; @@ -54,7 +54,7 @@ class TimelineController extends Controller ->whereNull('reblog_of_id') ->whereVisibility('public') ->withCount(['comments', 'likes']) - ->orderBy('id', 'desc') + ->orderBy('created_at', 'desc') ->simplePaginate(20); $type = 'local';