Files
coolify/app/Livewire/LayoutPopups.php
T
Andras BacsaiandClaude Opus 5.5 3452faec87 fix(livewire): bind team broadcast listeners to the mounted team
Livewire rebuilds listener names from the session team on every event
call. After a team switch in another tab, open pages still listen on the
old team channel, so events failed with EventHandlerDoesNotExist (500),
or ran handlers that load resources scoped to the new team (404).

Store the team at mount and build team channel listeners from it. Events
for a team that is no longer the session team are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:31:32 +02:00

29 lines
511 B
PHP

<?php
namespace App\Livewire;
use App\Traits\ListensToTeamChannel;
use Livewire\Component;
class LayoutPopups extends Component
{
use ListensToTeamChannel;
public function getListeners()
{
return $this->teamChannelListeners([
'TestEvent' => 'testEvent',
]);
}
public function testEvent()
{
$this->dispatch('success', 'Realtime events configured!');
}
public function render()
{
return view('livewire.layout-popups');
}
}