<?php

namespace App\Models;

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

class MexcoSupportTicketMessage extends Model
{
    public $timestamps = false;

    protected $table = 'mexco_support_ticket_messages';

    protected $fillable = [
        'ticket_id',
        'author_type',
        'author_id',
        'body',
        'created_at',
    ];

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

    public function ticket(): BelongsTo
    {
        return $this->belongsTo(MexcoSupportTicket::class, 'ticket_id');
    }
}
