33 lines
588 B
PHP
Executable File
33 lines
588 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TutorialQuestion extends Model
|
|
{
|
|
protected $fillable = [
|
|
'question',
|
|
'options',
|
|
'correct_answer',
|
|
'explanation',
|
|
'order',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'options' => 'array',
|
|
'order' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function lesson(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TutorialLesson::class);
|
|
}
|
|
}
|