Skip to content

Commit

Permalink
+ add support for livewire 3
Browse files Browse the repository at this point in the history
+ fixes on `onTabIn` and `onTabOut` hooks
  • Loading branch information
vildanbina committed Aug 3, 2024
1 parent 240fd4a commit 9825e0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ use Vildanbina\LivewireTabs\Components\Tab;

class General extends Tab
{
public function onTabIn($name, $value)
public function onTabIn($newTab)
{
// Something you want
}

public function onTabOut($name, $value)
public function onTabOut($oldTab)
{
// Something you want
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^8.0|^8.1",
"livewire/livewire": "^2.0",
"livewire/livewire": "^2.0|^3.0",
"spatie/laravel-package-tools": "^1.9"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/TabsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public function setTab($tab): void
{
$this->callHook('beforeSetTab', $this->activeTab, $tab);

$this->getCurrentTab()->callHook('onTabOut');
$this->getCurrentTab()->callHook('onTabOut', $this->activeTab);

$this->activeTab = $tab;

$this->getCurrentTab()->callHook('onTabIn');
$this->getCurrentTab()->callHook('onTabIn', $tab);

$this->callHook('afterSetTab', $this->activeTab, $tab);
}
Expand Down

0 comments on commit 9825e0c

Please sign in to comment.