27 lines
466 B
PHP
27 lines
466 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class QuestionOption extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'question_id',
|
|
'option_text',
|
|
'is_correct',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_correct' => 'boolean',
|
|
];
|
|
|
|
public function question()
|
|
{
|
|
return $this->belongsTo(Question::class, 'question_id');
|
|
}
|
|
}
|