<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class UserAnswerDetail extends LegacyModel
{
    protected $table = 'useranswerdetails';

    protected function casts(): array
    {
        return [
            'createdtime' => 'datetime',
            'gkuseranswer' => 'array',
            'gkcorrectanswer' => 'array',
            'scienceuseranswer' => 'array',
            'sciencecorrectanswer' => 'array',
            'hindiuseranswer' => 'array',
            'hindicorrectanswer' => 'array',
            'englishuseranswer' => 'array',
            'englishcorrectanswer' => 'array',
            'mathsusersanswer' => 'array',
            'mathscorrectanswer' => 'array',
        ];
    }

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