diff --git a/app/Events/EventParticipationCancelled.php b/app/Events/EventParticipationCancelled.php new file mode 100644 index 0000000..679fe7e --- /dev/null +++ b/app/Events/EventParticipationCancelled.php @@ -0,0 +1,47 @@ +userId = $userId; + $this->event = $event; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('user.' . $this->userId), + ]; + } + + public function broadcastAs() + { + return 'event.participation.cancelled'; + } +} diff --git a/app/Events/TaskParticipationCancelled.php b/app/Events/TaskParticipationCancelled.php new file mode 100644 index 0000000..2a45dd3 --- /dev/null +++ b/app/Events/TaskParticipationCancelled.php @@ -0,0 +1,50 @@ +userId = $userId; + $this->task = $task; + $this->event = $event; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('user.' . $this->userId), + ]; + } + + public function broadcastAs() + { + return 'task.participation.cancelled'; + } +} diff --git a/app/Events/VolunteerAssignedToTask.php b/app/Events/VolunteerAssignedToTask.php new file mode 100644 index 0000000..959dc0c --- /dev/null +++ b/app/Events/VolunteerAssignedToTask.php @@ -0,0 +1,50 @@ +userId = $userId; + $this->task = $task; + $this->event = $event; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('user.' . $this->userId), + ]; + } + + public function broadcastAs() + { + return 'volunteer.assigned.to.task'; + } +} diff --git a/app/Events/VolunteerUnassignedFromTask.php b/app/Events/VolunteerUnassignedFromTask.php new file mode 100644 index 0000000..5ff4e43 --- /dev/null +++ b/app/Events/VolunteerUnassignedFromTask.php @@ -0,0 +1,50 @@ +userId = $userId; + $this->task = $task; + $this->event = $event; + } + + /** + * Get the channels the event should broadcast on. + * + * @return array + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('user.' . $this->userId), + ]; + } + + public function broadcastAs() + { + return 'volunteer.unassigned.to.task'; + } +}