-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGreetNotification.php
executable file
·60 lines (53 loc) · 1.38 KB
/
GreetNotification.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace App\Notifications;
use App\Models\User;
use App\Notifications\Channels\SiteChannel;
use App\Notifications\Channels\SiteMessage;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
class GreetNotification extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return [
SiteChannel::class,
];
}
/**
* Get the app representation of the notification.
*
* @param mixed $user
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toSite(User $user)
{
return (new SiteMessage())
->title('Присоединяйтесь к нашему Telegram-каналу прямо сейчас для актуальных новостей и эксклюзивных анонсов.')
->action(config('services.telegram.channel_url'), 'Подписаться');
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
}