diff --git a/app/Telegram/TelegramNotification.php b/app/Telegram/TelegramNotification.php new file mode 100644 index 000000000..a24f9caad --- /dev/null +++ b/app/Telegram/TelegramNotification.php @@ -0,0 +1,48 @@ +message = $message; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['telegram']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toTelegram($notifiable) + { + return TelegramMessage::create() + ->to($notifiable->routes['telegram_chat_id']) + ->content($this->message); + } +}