<?php

namespace App\Models;

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

class ExternalChatMessage extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    protected $casts = [
        'meta' => 'array',
        'sent_at' => 'datetime',
    ];

    public function session()
    {
        return $this->belongsTo(ExternalChatSession::class, 'external_chat_session_id');
    }
}
