1 | <?php |
||
2 | |||
3 | namespace Innoflash\Events\Events\Guest; |
||
4 | |||
5 | use Illuminate\Broadcasting\InteractsWithSockets; |
||
6 | use Illuminate\Broadcasting\PrivateChannel; |
||
7 | use Illuminate\Foundation\Events\Dispatchable; |
||
8 | use Illuminate\Queue\SerializesModels; |
||
9 | use Innoflash\Events\Models\Guest; |
||
10 | |||
11 | class Saved |
||
12 | { |
||
13 | use Dispatchable, InteractsWithSockets, SerializesModels; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
14 | |||
15 | protected $guest; |
||
16 | |||
17 | protected $image; |
||
18 | |||
19 | /** |
||
20 | * Create a new event instance. |
||
21 | * |
||
22 | * @return void |
||
23 | */ |
||
24 | public function __construct(Guest $guest, $image) |
||
25 | { |
||
26 | $this->guest = $guest; |
||
27 | $this->image = $image; |
||
28 | } |
||
29 | |||
30 | public function getGuest(): Guest |
||
31 | { |
||
32 | return $this->guest; |
||
33 | } |
||
34 | |||
35 | public function getImage(): string |
||
36 | { |
||
37 | return $this->image; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Get the channels the event should broadcast on. |
||
42 | * |
||
43 | * @return \Illuminate\Broadcasting\Channel|array |
||
44 | */ |
||
45 | public function broadcastOn() |
||
46 | { |
||
47 | return new PrivateChannel('channel-name'); |
||
48 | } |
||
49 | } |
||
50 |