This commit is contained in:
Andras Bacsai
2023-12-05 15:19:54 +01:00
parent e0cefc787a
commit d59ec2548a
3 changed files with 19 additions and 12 deletions

View File

@@ -13,14 +13,16 @@ use Illuminate\Queue\SerializesModels;
class TestEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $teamId;
public function __construct()
{
$this->teamId = auth()->user()->currentTeam()->id;
}
public function broadcastOn(): array
{
return [
new Channel('public'),
new PrivateChannel("custom.{$this->teamId}"),
];
}
}