1 | <?php |
||
14 | class Monitor extends Model |
||
15 | { |
||
16 | use SupportsUptimeCheck; |
||
17 | use SupportsCertificateCheck; |
||
18 | use MonitorPresenter; |
||
19 | |||
20 | protected $guarded = []; |
||
21 | |||
22 | protected $dates = [ |
||
23 | 'uptime_last_check_date', |
||
24 | 'uptime_status_last_change_date', |
||
25 | 'uptime_check_failed_event_fired_on_date', |
||
26 | 'certificate_expiration_date', |
||
27 | ]; |
||
28 | |||
29 | protected $casts = [ |
||
30 | 'uptime_check_enabled' => 'boolean', |
||
31 | 'certificate_check_enabled' => 'boolean', |
||
32 | ]; |
||
33 | |||
34 | public function getUptimeCheckAdditionalHeadersAttribute($additionalHeaders) |
||
40 | |||
41 | public function setUptimeCheckAdditionalHeadersAttribute(array $additionalHeaders) |
||
45 | |||
46 | public function scopeEnabled($query) |
||
52 | |||
53 | /** |
||
54 | * @return \Spatie\Url\Url|null |
||
55 | */ |
||
56 | public function getUrlAttribute() |
||
64 | |||
65 | public static function boot() |
||
75 | |||
76 | public function isHealthy() |
||
88 | |||
89 | /** |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function enable() |
||
104 | |||
105 | /** |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function disable() |
||
117 | |||
118 | protected static function alreadyExists(Monitor $monitor): bool |
||
128 | } |
||
129 |