Skip to content

Commit 693058b

Browse files
committed
Refactor LinkElementMixin to use attributes method for wire directives
1 parent e06ae26 commit 693058b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Support/Html/Mixins/LinkElementMixin.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public function link(): mixed
1414
$href = route($route, ...$parameters);
1515

1616
return $this
17-
->attribute('wire:navigate')
18-
->href($href)
19-
->class([
20-
'link',
21-
'link-active' => request()->routeIs($route, "{$route}.*") || request()->fullUrlIs($href),
22-
]);
17+
->attributes([
18+
'wire:navigate',
19+
'wire:current' => 'link-active',
20+
])
21+
->class('link')
22+
->href($href);
2323
};
2424
}
2525

0 commit comments

Comments
 (0)