<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Logs extends Model
{
use HasFactory;
protected $table = 'logs';
protected $fillable = [
'user_id',
'action',
'action_id',
'action_detail',
];
/**
* Get the user that performed the action
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id', 'id');
}
/**
* Get the complaint related to this log entry
*/
public function complaint()
{
return $this->belongsTo(Complaints::class, 'action_id', 'id');
}
}