From 9a50a6f6278aee80f4aee737865d7cb75c967fd6 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 1 Oct 2019 21:52:27 -0600 Subject: [PATCH] Update ApiController --- app/Http/Controllers/Api/ApiV1Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index ea4a4258a..0c4526635 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1164,14 +1164,14 @@ class ApiV1Controller extends Controller $id = $min ?? $max; $notifications = Notification::whereProfileId($pid) ->whereDate('created_at', '>', $timeago) - ->latest() ->where('id', $dir, $id) + ->orderByDesc('created_at') ->limit($limit) ->get(); } else { $notifications = Notification::whereProfileId($pid) ->whereDate('created_at', '>', $timeago) - ->latest() + ->orderByDesc('created_at') ->simplePaginate($limit); } $resource = new Fractal\Resource\Collection($notifications, new NotificationTransformer());