From 753866c1ea7f0380e6da29e76d477067fa929d94 Mon Sep 17 00:00:00 2001 From: Rastislav Chynoransky Date: Tue, 9 Jul 2024 19:27:33 +0200 Subject: [PATCH] Fix ordering of artworks listing --- app/Http/Controllers/ArtworkController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ArtworkController.php b/app/Http/Controllers/ArtworkController.php index 6a3610f..82957e9 100644 --- a/app/Http/Controllers/ArtworkController.php +++ b/app/Http/Controllers/ArtworkController.php @@ -20,7 +20,9 @@ public function index(Request $request) ->presentable() ->filteredBySearchRequest($request) ->with(['authors', 'coverPhotoMedia', 'yearBuilt']) - ->orderByDesc('is_promoted', 'created_at') + ->orderByDesc('is_promoted') + ->orderByDesc('created_at') + ->orderBy('id') ->paginate(12); return view('artworks.index', compact(['artworks', 'categories']));