web_notifications) { $channels[] = 'database'; $channels[] = 'broadcast'; } if ($notifiable->email_notifications) { $channels[] = 'mail'; } return $channels; } public function toDatabase($notifiable): array { return [ 'message' => "Vous avez été désassigné de la tâche {$this->task->name} de l'événement {$this->event->name}.", 'task_id' => $this->task->id, 'event_id' => $this->event->id, ]; } public function toBroadcast($notifiable): BroadcastMessage { return new BroadcastMessage($this->toDatabase($notifiable)); } public function toMail($notifiable): void { Mail::to($notifiable->email)->send(new VolunteerUnassignToTaskMail([ 'name' => $notifiable->name, 'lastname' => $notifiable->lastname, 'taskName' => $this->task->name, 'start' => $this->task->start, 'end' => $this->task->end, 'eventName' => $this->event->name, ])); } }