Files
ladill-servers/app/Models/HostingAccountAlert.php
isaaccladandCursor b6c8ac343f Extract Ladill Servers as standalone app at servers.ladill.com.
VPS and dedicated server ordering, managed panels, SSO, billing, and launcher integration — forked from hosting infrastructure with server-focused routes and dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 19:18:30 +00:00

44 lines
1022 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class HostingAccountAlert extends Model
{
use HasFactory;
public const TYPE_WARNING = 'warning';
public const TYPE_LIMIT_EXCEEDED = 'limit_exceeded';
public const TYPE_THROTTLED = 'throttled';
public const TYPE_SUSPENDED = 'suspended';
protected $fillable = [
'hosting_account_id',
'alert_type',
'severity',
'message',
'resource_usage',
'is_resolved',
'resolved_at',
];
protected $casts = [
'resource_usage' => 'array',
'is_resolved' => 'boolean',
'resolved_at' => 'datetime',
];
public function account(): BelongsTo
{
return $this->belongsTo(HostingAccount::class, 'hosting_account_id');
}
public function scopeUnresolved($query)
{
return $query->where('is_resolved', false);
}
}