<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Server extends Model
{
    protected $fillable = [
        'name',
        'hostname',
        'ip_address',
        'provider',
        'type',
        'specs',
        'cost',
        'status',
        'renewal_date',
        'notes',
    ];

    protected $casts = [
        'cost' => 'decimal:2',
        'renewal_date' => 'date',
    ];

    public function domains(): HasMany
    {
        return $this->hasMany(Domain::class);
    }
}
