<?php

namespace App\Models;

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

class TopicQuestionAnswer extends Model
{
    use HasFactory;

    protected $table = 'topic_question_answers';
    protected $fillable = [
        'topic_id',
        'question_id',
        'answer'
    ];
    
    protected $casts = [
        'topic_id' => 'integer',
        'question_id' => 'integer',
    ];

    public function question()
    {
        return $this->belongsTo(TopicQuestion::class, 'question_id');
    }
}
