Files
speedtest-tracker/app/Notifications/Telegram/TestNotification.php
T
Alex Justesen b29290913a Laravel 10.x Shift (#576)
Co-authored-by: Shift <shift@laravelshift.com>
2023-05-07 11:22:45 -04:00

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.');
}
}