Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Jul 8, 2024
1 parent 4cdae82 commit 1d1401a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/Support/Html/Mixins/BaseElementMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

class BaseElementMixin
{
public function wireKey(): mixed
public function navigate(): mixed
{
return function (?string $value = null): BaseElement {
return function (): BaseElement {
/** @var BaseElement $this */

return $this->attribute('wire:key', $value);
return $this->attribute('wire:navigate');
};
}

public function wireIgnore(): mixed
public function ignore(): mixed
{
return function (?bool $self = false): BaseElement {
/** @var BaseElement $this */
Expand All @@ -27,21 +27,21 @@ public function wireIgnore(): mixed
};
}

public function wireNavigate(): mixed
public function submit(): mixed
{
return function (): BaseElement {
return function (?string $action = null): BaseElement {
/** @var BaseElement $this */

return $this->attribute('wire:navigate');
return $this->attribute('wire:submit', $action);
};
}

public function wireSubmit(): mixed
public function wireKey(): mixed
{
return function (?string $action = null): BaseElement {
return function (?string $value = null): BaseElement {
/** @var BaseElement $this */

return $this->attribute('wire:submit', $action);
return $this->attribute('wire:key', $value);
};
}

Expand Down
3 changes: 2 additions & 1 deletion src/Support/Html/Mixins/LinkElementMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ public function route(): mixed
$href = route($route, ...$parameters);

return $this

Check failure on line 15 in src/Support/Html/Mixins/LinkElementMixin.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Spatie\Html\BaseElement::href().
->navigate()
->href($href)
->class([
'link',
'link-active' => request()->routeIs($route) || request()->fullUrlIs($href),
'link-active' => request()->routeIs($route, "{$route}.*") || request()->fullUrlIs($href),
]);
};
}
Expand Down

0 comments on commit 1d1401a

Please sign in to comment.