'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); } }