web_notifications) { $channels[] = 'database'; $channels[] = 'broadcast'; } if ($notifiable->email_notifications) { $channels[] = 'mail'; } return $channels; } public function toDatabase($notifiable): array { return [ 'message' => "Votre rôle a changé pour : {$this->role}", 'role' => $this->role, ]; } public function toBroadcast($notifiable): BroadcastMessage { return new BroadcastMessage($this->toDatabase($notifiable)); } public function toMail($notifiable): void { Mail::to($notifiable->email)->send(new UpdateRoleMail([ 'name' => $notifiable->name, 'lastname' => $notifiable->lastname, 'role' => $this->role, ])); } }