Skip to content

Commit

Permalink
Refactor LinkElementMixin to use attributes method for wire directives
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Nov 27, 2024
1 parent e06ae26 commit 693058b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Support/Html/Mixins/LinkElementMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public function link(): mixed
$href = route($route, ...$parameters);

return $this
->attribute('wire:navigate')
->href($href)
->class([
'link',
'link-active' => request()->routeIs($route, "{$route}.*") || request()->fullUrlIs($href),
]);
->attributes([
'wire:navigate',
'wire:current' => 'link-active',
])
->class('link')
->href($href);
};
}

Expand Down

0 comments on commit 693058b

Please sign in to comment.