web_notifications) { $channels[] = 'database'; $channels[] = 'broadcast'; } if ($notifiable->email_notifications) { $channels[] = 'mail'; } return $channels; } public function toDatabase($notifiable): array { return [ 'message' => "L'événement {$this->event->name} a été supprimé. Vous n'y participez donc plus.", '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 EventParticipationCancelledMail([ 'name' => $notifiable->name, 'lastname' => $notifiable->lastname, 'eventName' => $this->event->name, 'start' => $this->event->start, 'end' => $this->event->end, ])); } }