<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LitespeedSnapshot extends Model
{
    use HasFactory;
    public $timestamps = false;
    protected $fillable = [
        'server_id', 'measured_at', 'version', 'license_type', 'license_expires_at',
        'connections_current', 'connections_max', 'requests_per_second',
        'bandwidth_in_kbps', 'bandwidth_out_kbps',
        'cache_hit_ratio_percent', 'cache_size_bytes', 'vhost_count',
    ];
    protected $casts = [
        'measured_at' => 'datetime',
        'license_expires_at' => 'date',
    ];
    public function server(): BelongsTo { return $this->belongsTo(Server::class); }
}
