Skip to content

Commit

Permalink
Merge pull request #29 from ainesophaur/bugfix/knowledge-base-sort-wa…
Browse files Browse the repository at this point in the history
…rning
  • Loading branch information
lukas-frey authored Jun 20, 2024
2 parents 42d8261 + 3ed9149 commit 0c1decd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Filament/Panels/KnowledgeBasePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected function buildNavigationItem(Documentable $documentable)
->where('parent', $documentable->getTitle())
->get()
->filter(fn (Documentable $documentable) => $documentable->isRegistered())
->sort(fn (Documentable $d1, Documentable $d2) => $d1->getOrder() >= $d2->getOrder())
->sort(fn (Documentable $d1, Documentable $d2) => $d1->getOrder() <=> $d2->getOrder())
->map(fn (Documentable $documentable) => $this->buildNavigationItem($documentable))
->toArray()
)
Expand Down Expand Up @@ -276,7 +276,7 @@ protected function makeNavigation(NavigationBuilder $builder): NavigationBuilder
: NavigationGroup::make($key)
->items(
$items
->sort(fn (Documentable $d1, Documentable $d2) => $d1->getOrder() >= $d2->getOrder())
->sort(fn (Documentable $d1, Documentable $d2) => $d1->getOrder() <=> $d2->getOrder())
->map(fn (Documentable $documentable) => $this->buildNavigationItem($documentable))
->toArray()
)
Expand Down

0 comments on commit 0c1decd

Please sign in to comment.