Skip to content

Commit 9825e0c

Browse files
committed
+ add support for livewire 3
+ fixes on `onTabIn` and `onTabOut` hooks
1 parent 240fd4a commit 9825e0c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ use Vildanbina\LivewireTabs\Components\Tab;
165165

166166
class General extends Tab
167167
{
168-
public function onTabIn($name, $value)
168+
public function onTabIn($newTab)
169169
{
170170
// Something you want
171171
}
172172

173-
public function onTabOut($name, $value)
173+
public function onTabOut($oldTab)
174174
{
175175
// Something you want
176176
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^8.0|^8.1",
22-
"livewire/livewire": "^2.0",
22+
"livewire/livewire": "^2.0|^3.0",
2323
"spatie/laravel-package-tools": "^1.9"
2424
},
2525
"autoload": {

src/TabsComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public function setTab($tab): void
3636
{
3737
$this->callHook('beforeSetTab', $this->activeTab, $tab);
3838

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

4141
$this->activeTab = $tab;
4242

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

4545
$this->callHook('afterSetTab', $this->activeTab, $tab);
4646
}

0 commit comments

Comments
 (0)