Skip to content

Commit 1beec7e

Browse files
committed
Update the make method to support extra attributes
1 parent 33e40d8 commit 1beec7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/framework/src/Framework/Features/Navigation/NavigationItem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ public function isActive(): bool
103103
return Hyde::currentRoute()?->getLink() === $this->getLink();
104104
}
105105

106-
/** @return array{\Hyde\Support\Models\Route|string, string, int} */
107-
protected static function make(Route|string $destination, ?string $label = null, ?int $priority = null): array
106+
/** @return array{\Hyde\Support\Models\Route|string, string, int, array<string, scalar>} */
107+
protected static function make(Route|string $destination, ?string $label = null, ?int $priority = null, array $attributes = []): array
108108
{
109109
// Automatically resolve the destination if it's a route key.
110110
if (is_string($destination) && Routes::has($destination)) {
@@ -117,7 +117,7 @@ protected static function make(Route|string $destination, ?string $label = null,
117117
$priority ??= $destination->getPage()->navigationMenuPriority();
118118
}
119119

120-
return [$destination, $label ?? $destination, $priority ?? NavigationMenu::DEFAULT];
120+
return [$destination, $label ?? $destination, $priority ?? NavigationMenu::DEFAULT, $attributes];
121121
}
122122

123123
/** @return array<string, scalar> */

0 commit comments

Comments
 (0)