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