Skip to content

Commit

Permalink
Inline usage of deprecated method for merged replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Feb 29, 2024
1 parent 6af588a commit 9224e9e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ public static function fromRoute(Route $route, ?string $label = null, ?int $prio
*/
public static function forRoute(Route|string $route, ?string $label = null, ?int $priority = null, ?string $group = null): static
{
return static::fromRoute($route instanceof Route ? $route : Routes::getOrFail($route), $label, $priority, $group);
return new static(
$route instanceof Route ? $route : Routes::getOrFail($route),
$label ?? $route instanceof Route ? $route : Routes::getOrFail($route)->getPage()->navigationMenuLabel(),
$priority ?? $route instanceof Route ? $route : Routes::getOrFail($route)->getPage()->navigationMenuPriority(),
$group ?? $route instanceof Route ? $route : Routes::getOrFail($route)->getPage()->navigationMenuGroup(),
);
}

/**
Expand Down

0 comments on commit 9224e9e

Please sign in to comment.