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(), ]); }