File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Notifications \Telegram ;
44
5+ use App \Settings \NotificationSettings ;
56use Illuminate \Bus \Queueable ;
67use Illuminate \Contracts \Queue \ShouldQueue ;
78use Illuminate \Notifications \Notification ;
@@ -11,6 +12,18 @@ class TestNotification extends Notification implements ShouldQueue
1112{
1213 use Queueable;
1314
15+ protected $ settings ;
16+
17+ /**
18+ * Create a new notification instance.
19+ *
20+ * @return void
21+ */
22+ public function __construct ($ message )
23+ {
24+ $ this ->settings = new NotificationSettings ();
25+ }
26+
1427 /**
1528 * Get the notification's delivery channels.
1629 *
@@ -30,6 +43,7 @@ public function toTelegram(object $notifiable): TelegramMessage
3043 {
3144 return TelegramMessage::create ()
3245 ->to ($ notifiable ->routes ['telegram_chat_id ' ])
46+ ->disableNotification ($ this ->settings ->telegram_disable_notification )
3347 ->content ('👋 Testing the Telegram notification channel. ' );
3448 }
3549}
Original file line number Diff line number Diff line change 22
33namespace App \Telegram ;
44
5+ use App \Settings \NotificationSettings ;
56use Illuminate \Bus \Queueable ;
67use Illuminate \Notifications \Notification ;
78use NotificationChannels \Telegram \TelegramMessage ;
@@ -12,6 +13,8 @@ class TelegramNotification extends Notification
1213
1314 protected $ message ;
1415
16+ protected $ settings ;
17+
1518 /**
1619 * Create a new notification instance.
1720 *
@@ -20,6 +23,8 @@ class TelegramNotification extends Notification
2023 public function __construct ($ message )
2124 {
2225 $ this ->message = $ message ;
26+
27+ $ this ->settings = new NotificationSettings ();
2328 }
2429
2530 /**
@@ -41,6 +46,7 @@ public function toTelegram($notifiable): TelegramMessage
4146 {
4247 return TelegramMessage::create ()
4348 ->to ($ notifiable ->routes ['telegram_chat_id ' ])
49+ ->disableNotification ($ this ->settings ->telegram_disable_notification )
4450 ->content ($ this ->message );
4551 }
4652}
Original file line number Diff line number Diff line change 66 /**
77 * Build information
88 */
9- 'build_date ' => Carbon::parse ('2024-02-06 ' ),
9+ 'build_date ' => Carbon::parse ('2024-02-07 ' ),
1010
11- 'build_version ' => 'v0.15.0 ' ,
11+ 'build_version ' => 'v0.15.1 ' ,
1212
1313 /**
1414 * General
You can’t perform that action at this time.
0 commit comments