@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | /** @return $this */ |
| 13 | 13 | public function generate(): static |
| 14 | 14 | { |
| 15 | - RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function (Route $route) { |
|
| 16 | - if (! $route->getSourceModel()->get('hidden', false)) { |
|
| 15 | + RoutingService::getInstance()->getRoutesForModel(DocumentationPage::class)->each(function(Route $route) { |
|
| 16 | + if (!$route->getSourceModel()->get('hidden', false)) { |
|
| 17 | 17 | $this->items->push(NavItem::fromRoute($route)->setPriority($this->getPriorityForRoute($route))); |
| 18 | 18 | } |
| 19 | 19 | }); |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function getGroups(): array |
| 30 | 30 | { |
| 31 | - return $this->items->map(function (NavItem $item) { |
|
| 31 | + return $this->items->map(function(NavItem $item) { |
|
| 32 | 32 | return $item->getGroup(); |
| 33 | 33 | })->unique()->toArray(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function getItemsInGroup(?string $group): Collection |
| 37 | 37 | { |
| 38 | - return $this->items->filter(function ($item) use ($group) { |
|
| 38 | + return $this->items->filter(function($item) use ($group) { |
|
| 39 | 39 | return $item->getGroup() === $group || $item->getGroup() === Str::slug($group); |
| 40 | 40 | })->sortBy('priority')->values(); |
| 41 | 41 | } |