<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EventLog extends Model
{
    protected $table = 'event_logs';

    protected $fillable = [
        'task_id',
        'meeting_id',
        'demo_id',
        'created_by',
        'log',
        'duration_seconds',
        'is_deleted',
        'created_at',
        'updated_at',
        'deleted_at',
    ];

    public function task(): BelongsTo
    {
        return $this->belongsTo(Task::class);
    }

    public function meeting(): BelongsTo
    {
        return $this->belongsTo(Meeting::class);
    }

    public function demo(): BelongsTo
    {
        return $this->belongsTo(Demo::class);
    }

    public function creator(): BelongsTo
    {
        return $this->belongsTo(User::class, 'created_by');
    }
}
