<?php

namespace App\Models;

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

class LogHistory extends Model
{
    use HasFactory;

    protected $fillable = [
        'log_type',
        'log_id',
        'old_info',
        'new_info',
        'edit_by'
    ];

    public function nas()
    {
        return $this->belongsTo(Nas::class, 'log_id', 'id');
    }

    public function pop()
    {
        return $this->belongsTo(Pop::class, 'log_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'edit_by', 'id');
    }
}
