<?php

namespace App\Models;

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

class LogSeguridad extends Model
{
    use HasFactory;
    
    protected $table = 'logseguridades';
    public $timestamps = false;

    protected $fillable = [
        'descripcion',
        'fechahora',
        'IPorigen',
        'rol',
        'persona_id',
        'accion_id',
        'accion_descripcion',
        'responsable_nombre',
    ];

    //pertenece a

    public function accion() 
    {
        return $this->belongsTo(AccionLog::class, 'accion_id', 'id');
    }

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