<?php

namespace App\Models;

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

class Administrador extends Model
{
    use HasFactory;
    protected $table = 'administradores';
    
    protected $fillable = [
        'persona_id',
        'dni',
        'correo',
        'pregunta_secreta_hash',
        'respuesta_secreta_hash',
        'credencialprofesional_id',
    ];

    public function credencial()
    {
        return $this->belongsTo(CredencialProfesional::class, 'credencialprofesional_id','id');
    }
    public function persona()
    {
        return $this->belongsTo(Persona::class, 'persona_id','id');
    }
}
