attributes['status']) {
'activated' => 'Activated',
'Stopped' => 'Stopped',
default => 'Unknown',
};
}
public function servesHosting(): bool
{
$type = $this->attributes['type'] ?? ServerType::DOMAIN->value;
return in_array($type, [ServerType::HOSTING->value, ServerType::BOTH->value], true);
}
protected function scopeIsActive($query)
{
return $query->where('status', 'activated');
}
}