forked from liberu-genealogy/genealogy-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResearchSpaceUpdated.php
More file actions
37 lines (29 loc) · 872 Bytes
/
ResearchSpaceUpdated.php
File metadata and controls
37 lines (29 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class ResearchSpaceUpdated implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public int $researchSpaceId;
public array $payload;
public function __construct(int $researchSpaceId, array $payload = [])
{
$this->researchSpaceId = $researchSpaceId;
$this->payload = $payload;
}
public function broadcastAs(): string
{
return 'ResearchSpaceUpdated';
}
public function broadcastWith(): array
{
return $this->payload;
}
public function broadcastOn()
{
return ['research-space.' . $this->researchSpaceId];
}
}