some progress

This commit is contained in:
Doar Mihai
2026-01-17 16:42:43 +02:00
parent 030a105992
commit 3665a1d5a3
57 changed files with 5804 additions and 3 deletions
+27
View File
@@ -11,15 +11,42 @@ class UptimeCheck extends Model
protected $fillable = [
'site_id',
'check_type',
'status_code',
'response_time_ms',
'is_online',
'checked_at',
];
protected $casts = [
'checked_at' => 'datetime',
'is_online' => 'boolean',
];
/**
* Scope to filter by check type.
*/
public function scopeOfType($query, string $type)
{
return $query->where('check_type', $type);
}
/**
* Scope to filter HTTP checks.
*/
public function scopeHttpChecks($query)
{
return $query->where('check_type', 'http');
}
/**
* Scope to filter ping checks.
*/
public function scopePingChecks($query)
{
return $query->where('check_type', 'ping');
}
public function site(): BelongsTo
{
return $this->belongsTo(Site::class);