Skip to content

Commit 908f8e8

Browse files
Merge pull request #1466 from liberu-genealogy/copilot/fix-protected-property-access
Fix protected property access on Filament v5 TenantSet event in SwitchTeam listener
2 parents a48c40d + fa51bdb commit 908f8e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/Listeners/SwitchTeam.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ public function handle(TenantSet $event): void
2121
{
2222
$user = auth()->user();
2323

24-
if ($user && $user->hasTeam($event->tenant)) {
25-
$user->switchTeam($event->tenant);
24+
$tenant = $event->getTenant();
25+
26+
if ($user && $user->hasTeam($tenant)) {
27+
$user->switchTeam($tenant);
2628
}
2729
}
2830
}

0 commit comments

Comments
 (0)