web_notifications) { $channels[] = 'database'; $channels[] = 'broadcast'; } if ($notifiable->email_notifications) { $channels[] = 'mail'; } return $channels; } public function toDatabase($notifiable): array { return [ 'message' => "Nouvelle demande d'inscription : {$this->user->name} {$this->user->lastname}", 'user_id' => $this->user->id, ]; } public function toBroadcast($notifiable): BroadcastMessage { return new BroadcastMessage($this->toDatabase($notifiable)); } public function toMail($notifiable): MailMessage { Mail::to($notifiable->email)->send(new RegisterMail([ 'adminName' => $notifiable->name, 'adminLastname'=> $notifiable->lastname, 'userName' => $this->user->name, 'userLastname' => $this->user->lastname, ])); return (new MailMessage); } }