mirror of
https://github.com/bdnugget/speedtest-tracker.git
synced 2026-11-07 08:37:27 +00:00
36 lines
877 B
PHP
36 lines
877 B
PHP
<?php
|
|
|
|
namespace App\Notifications\Telegram;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Notification;
|
|
use NotificationChannels\Telegram\TelegramMessage;
|
|
|
|
class TestNotification extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*
|
|
* @return array<int, string>
|
|
*/
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['telegram'];
|
|
}
|
|
|
|
/**
|
|
* Get the Telegram representation of the notification.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toTelegram(object $notifiable): TelegramMessage
|
|
{
|
|
return TelegramMessage::create()
|
|
->to($notifiable->routes['telegram_chat_id'])
|
|
->content('👋 Testing the Telegram notification channel.');
|
|
}
|
|
}
|