<?php

namespace App\Models;

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

class FileDownload extends Model
{
    public $timestamps = false;

    protected $table = 'meet_file_downloads';

    protected $fillable = [
        'session_file_id', 'downloaded_by_ref', 'downloaded_by_name', 'ip_address', 'downloaded_at',
    ];

    protected function casts(): array
    {
        return ['downloaded_at' => 'datetime'];
    }

    public function file(): BelongsTo
    {
        return $this->belongsTo(SessionFile::class, 'session_file_id');
    }
}
