<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class OpsSoftware extends Model
{
    use HasFactory;

    protected $table = 'ops_softwares';

    protected $fillable = [
        'ops_protocol_id',
        'name',
        'client_path',
        'sort',
        'is_active',
    ];

    public function protocol(): BelongsTo
    {
        return $this->belongsTo(OpsProtocol::class, 'ops_protocol_id');
    }

    protected function casts(): array
    {
        return [
            'is_active' => 'boolean',
        ];
    }
}
