akubiczek /
applicake-backend
| 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 CandidateMoved |
||
| 12 | { |
||
| 13 | use Dispatchable; |
||
| 14 | use InteractsWithSockets; |
||
| 15 | use SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 16 | |||
| 17 | /** |
||
| 18 | * @var Candidate |
||
| 19 | */ |
||
| 20 | public $candidate; |
||
| 21 | |||
| 22 | public $userId; |
||
| 23 | |||
| 24 | public $previousRecruitmentId; |
||
| 25 | public $newRecruitmentId; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Create a new event instance. |
||
| 29 | * |
||
| 30 | * @param Candidate $candidate |
||
| 31 | * @param $previousRecruitmentId |
||
| 32 | * @param $newRecruitmentId |
||
| 33 | * @param $userId |
||
| 34 | */ |
||
| 35 | public function __construct(Candidate $candidate, $previousRecruitmentId, $newRecruitmentId, $userId) |
||
| 36 | { |
||
| 37 | $this->candidate = $candidate; |
||
| 38 | $this->previousRecruitmentId = $previousRecruitmentId; |
||
| 39 | $this->newRecruitmentId = $newRecruitmentId; |
||
| 40 | $this->userId = $userId; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the channels the event should broadcast on. |
||
| 45 | * |
||
| 46 | * @return \Illuminate\Broadcasting\Channel|array |
||
| 47 | */ |
||
| 48 | public function broadcastOn() |
||
| 49 | { |
||
| 50 | return new PrivateChannel('channel-name'); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |