From 31c7b47548703909a4d8897d35243fa53c3459f6 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Thu, 19 Jan 2023 15:18:40 +0100 Subject: [PATCH] ->ordered() --- app/Http/Livewire/Library/SearchByTagComponent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Livewire/Library/SearchByTagComponent.php b/app/Http/Livewire/Library/SearchByTagComponent.php index 2bdab5d8..0a180cd9 100644 --- a/app/Http/Livewire/Library/SearchByTagComponent.php +++ b/app/Http/Livewire/Library/SearchByTagComponent.php @@ -31,7 +31,8 @@ class SearchByTagComponent extends Component ]) ->where('type', 'library_item') ->whereHas('libraryItems.libraries', fn($query) => $query->where('is_public', $shouldBePublic)) - ->ordered() + ->orderByDesc('library_items_count') + ->orderBy('tags.id') ->get(), ]); }