<?php

namespace App\Models;

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

class CertificadoFIEL extends Model
{
    protected $table = 'CertificadoFIEL';
    protected $primaryKey = 'id';
    public $timestamps = false;

    protected $fillable = [
        'id_proveedor',
        'cerFile',
        'keyFile',
        'password',
        'fechaAlta',
        'tipo',
        'status',
    ];

    protected $hidden = [
        'password',
    ];

    protected $casts = [
        'fechaAlta' => 'datetime',
    ];

    public function proveedor(): BelongsTo
    {
        return $this->belongsTo(Proveedor::class, 'id_proveedor', 'id_proveedor');
    }
}
