1 | <?php |
||
8 | abstract class BaseNotification extends Notification |
||
9 | { |
||
10 | /** |
||
11 | * Get the notification's delivery channels. |
||
12 | * |
||
13 | * @param mixed $notifiable |
||
14 | * @return array |
||
15 | */ |
||
16 | public function via($notifiable) |
||
|
|||
17 | { |
||
18 | return config('server-monitor.notifications.notifications.'.static::class); |
||
19 | } |
||
20 | |||
21 | public function getCheck(): Check |
||
22 | { |
||
23 | return $this->event->check; |
||
24 | } |
||
25 | |||
26 | protected function getMessageText(): ?string |
||
27 | { |
||
28 | return ucfirst($this->getCheck()->last_run_message); |
||
29 | } |
||
30 | |||
31 | protected function getSubject(): string |
||
32 | { |
||
33 | return "{$this->getCheck()->type} on {$this->getCheck()->host->name}"; |
||
34 | } |
||
35 | |||
36 | abstract public function shouldSend(): bool; |
||
37 | } |
||
38 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.