3131 */
3232class NavItem implements Stringable
3333{
34- protected ?Route $ destination ;
34+ protected ?Route $ route ;
3535 protected string $ label ;
3636 protected int $ priority ;
3737 protected ?string $ group ;
@@ -57,7 +57,7 @@ public function __construct(Route|string|null $destination, string $label, int $
5757 $ destination = Routes::get ($ destination ) ?? new ExternalRoute ($ destination );
5858 }
5959
60- $ this ->destination = $ destination ;
60+ $ this ->route = $ destination ;
6161 $ this ->label = $ label ;
6262 $ this ->priority = $ priority ;
6363 $ this ->group = static ::normalizeGroupKey ($ group );
@@ -118,15 +118,15 @@ public function __toString(): string
118118 */
119119 public function getDestination (): ?Route
120120 {
121- return $ this ->destination ;
121+ return $ this ->route ;
122122 }
123123
124124 /**
125125 * Resolve the destination link of the navigation item.
126126 */
127127 public function getLink (): string
128128 {
129- return (string ) $ this ->destination ;
129+ return (string ) $ this ->route ;
130130 }
131131
132132 /**
@@ -144,7 +144,7 @@ public function getLabel(): string
144144 */
145145 public function getPriority (): int
146146 {
147- if ($ this ->hasChildren () && $ this ->children [0 ]->getDestination ()->getPageClass () === DocumentationPage::class) {
147+ if ($ this ->hasChildren () && $ this ->children [0 ]->getRoute ()->getPageClass () === DocumentationPage::class) {
148148 return min ($ this ->priority , collect ($ this ->getChildren ())->min (fn (NavItem $ child ): int => $ child ->getPriority ()));
149149 }
150150
@@ -194,7 +194,7 @@ public function hasChildren(): bool
194194 */
195195 public function isCurrent (): bool
196196 {
197- return Hyde::currentRoute ()->getLink () === $ this ->destination ->getLink ();
197+ return Hyde::currentRoute ()->getLink () === $ this ->route ->getLink ();
198198 }
199199
200200 /**
@@ -207,7 +207,7 @@ public function addChild(NavItem $item): static
207207 $ item ->group ??= $ this ->group ;
208208
209209 $ this ->children [] = $ item ;
210- $ this ->destination = null ;
210+ $ this ->route = null ;
211211
212212 return $ this ;
213213 }
0 commit comments