Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/Notifications/Telegram/TestNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Notifications\Telegram;

use App\Settings\NotificationSettings;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
Expand All @@ -11,6 +12,18 @@ class TestNotification extends Notification implements ShouldQueue
{
use Queueable;

protected $settings;

/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($message)
{
$this->settings = new NotificationSettings();
}

/**
* Get the notification's delivery channels.
*
Expand All @@ -30,6 +43,7 @@ public function toTelegram(object $notifiable): TelegramMessage
{
return TelegramMessage::create()
->to($notifiable->routes['telegram_chat_id'])
->disableNotification($this->settings->telegram_disable_notification)
->content('👋 Testing the Telegram notification channel.');
}
}
6 changes: 6 additions & 0 deletions app/Telegram/TelegramNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Telegram;

use App\Settings\NotificationSettings;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use NotificationChannels\Telegram\TelegramMessage;
Expand All @@ -12,6 +13,8 @@ class TelegramNotification extends Notification

protected $message;

protected $settings;

/**
* Create a new notification instance.
*
Expand All @@ -20,6 +23,8 @@ class TelegramNotification extends Notification
public function __construct($message)
{
$this->message = $message;

$this->settings = new NotificationSettings();
}

/**
Expand All @@ -41,6 +46,7 @@ public function toTelegram($notifiable): TelegramMessage
{
return TelegramMessage::create()
->to($notifiable->routes['telegram_chat_id'])
->disableNotification($this->settings->telegram_disable_notification)
->content($this->message);
}
}
4 changes: 2 additions & 2 deletions config/speedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
/**
* Build information
*/
'build_date' => Carbon::parse('2024-02-06'),
'build_date' => Carbon::parse('2024-02-07'),

'build_version' => 'v0.15.0',
'build_version' => 'v0.15.1',

/**
* General
Expand Down