mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 07:20:09 +00:00
b29290913a
Co-authored-by: Shift <shift@laravelshift.com>
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.');
|
|
}
|
|
}
|