forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestNotification.php
More file actions
38 lines (32 loc) · 1.01 KB
/
TestNotification.php
File metadata and controls
38 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace App\Notifications\Apprise;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
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 ['apprise'];
}
/**
* Get the Apprise message representation of the notification.
*/
public function toApprise(object $notifiable): AppriseMessage
{
$body = '👋 This is a test notification from **'.config('app.name')."**.\n\n";
$body .= "If you're seeing this, your Apprise notification channel is configured correctly!\n\n";
return AppriseMessage::create()
->urls($notifiable->routes['apprise_urls'])
->title('Test Notification')
->body($body)
->type('info')
->format('markdown');
}
}