<?php

namespace App\Models;

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

class DnsTemplate extends Model
{
    protected $fillable = [
        'name',
        'description',
        'is_active',
        'allowed_plans',
    ];

    protected $casts = [
        'is_active' => 'boolean',
        'allowed_plans' => 'array',
    ];

    /**
     * Înregistrările din template
     */
    public function dnsRecords(): HasMany
    {
        return $this->hasMany(DnsTemplateRecord::class, 'dns_template_id');
    }
}
