1 | <?php |
||
14 | class Monitor extends Model |
||
15 | { |
||
16 | use SupportsUptimeCheck; |
||
17 | use SupportsCertificateCheck; |
||
18 | use MonitorPresenter; |
||
19 | |||
20 | protected $guarded = []; |
||
21 | |||
22 | protected $appends = ['raw_url']; |
||
23 | |||
24 | protected $dates = [ |
||
25 | 'uptime_last_check_date', |
||
26 | 'uptime_status_last_change_date', |
||
27 | 'uptime_check_failed_event_fired_on_date', |
||
28 | 'certificate_expiration_date', |
||
29 | ]; |
||
30 | |||
31 | protected $casts = [ |
||
32 | 'uptime_check_enabled' => 'boolean', |
||
33 | 'certificate_check_enabled' => 'boolean', |
||
34 | ]; |
||
35 | |||
36 | public function getUptimeCheckAdditionalHeadersAttribute($additionalHeaders): array |
||
42 | |||
43 | public function setUptimeCheckAdditionalHeadersAttribute(array $additionalHeaders): void |
||
47 | |||
48 | public function scopeEnabled($query) |
||
54 | |||
55 | public function getUrlAttribute(): ?Url |
||
63 | |||
64 | public function getRawUrlAttribute(): string |
||
68 | |||
69 | public static function booted() |
||
77 | |||
78 | public function isHealthy(): bool |
||
90 | |||
91 | public function enable(): self |
||
103 | |||
104 | public function disable(): self |
||
113 | |||
114 | protected static function alreadyExists(self $monitor): bool |
||
124 | } |
||
125 |