<?php

namespace App\Models;

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

class CredencialProfesional extends Model
{
    use HasFactory;
    protected $table = 'credencialesprofesionales';
    
    protected $fillable = [
        'usuario',
        'contra',
        'rol',
        'token',
        'fecha_hora',
        'reset_token',
        'reset_expira_en',
    ];

    public function profesional()
    {
        return $this->hasOne(Profesional::class, 'credencialprofesional_id', 'id');
    }
    
    public function administrador()
    {
        return $this->hasOne(Administrador::class, 'credencialprofesional_id', 'id');
    }

}
