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