Skip to content

Commit c298c24

Browse files
authored
Improve routeIs name match
1 parent c58a835 commit c298c24

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Support/Html/Mixins/LinkElementMixin.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ public function link(): mixed
1212
/** @var A $this */
1313
$href = route($route, ...$parameters);
1414

15+
$name = str($route)->before('.')->value();
16+
1517
return $this
1618
->attribute('wire:navigate')
1719
->href($href)
1820
->class([
1921
'link',
20-
'link-active' => request()->routeIs($route, "{$route}.*") || request()->fullUrlIs($href),
22+
'link-active' => request()->routeIs($name, "{$name}.*") || request()->fullUrlIs($href),
2123
]);
2224
};
2325
}

0 commit comments

Comments
 (0)