From a783cf698e5b1f5ddef34c84e317cb285dc2f52e Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 19 May 2022 17:23:48 +0200 Subject: [PATCH] Fix sidebar ordering bug Fix bug where categorized documentation sidebar items were not sorted. --- src/Concerns/HasDocumentationSidebarCategories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/HasDocumentationSidebarCategories.php b/src/Concerns/HasDocumentationSidebarCategories.php index 2971ff06..376c8eda 100644 --- a/src/Concerns/HasDocumentationSidebarCategories.php +++ b/src/Concerns/HasDocumentationSidebarCategories.php @@ -32,7 +32,7 @@ public function getItemsInCategory(string $category): DocumentationSidebar { return $this->sidebar->filter(function ($item) use ($category) { return $item->category === Str::slug($category); - }); + })->sortBy('priority')->values(); } protected function assembleCategories(): void