Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function via($notifiable) |
||
13 | { |
||
14 | /* @var $event \Spatie\ServerMonitor\Events\Event */ |
||
15 | $event = $notifiable->getEvent(); |
||
16 | /* @var $host \Spatie\ServerMonitor\Models\Host */ |
||
17 | $host = $event->check->host()->first(); |
||
18 | $notifications = $host->getCustomProperty('notifications'); |
||
19 | if(!$notifications) { |
||
20 | return config('server-monitor.notifications.notifications.'.static::class); |
||
21 | } |
||
22 | if(isset($notifications[static::class]) && isset($notifications[static::class]['channels'])) { |
||
23 | return $notifications[static::class]['channels']; |
||
24 | } |
||
25 | return []; |
||
26 | } |
||
28 |