Files
alrahma_sunday_school_api/app/Models/Quiz.php
T
2026-06-09 01:25:14 -04:00

56 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Quiz extends BaseModel
{
protected $table = 'quiz';
public $timestamps = false;
protected $fillable = [
'student_id',
'school_id',
'class_section_id',
'updated_by',
'quiz_index',
'score',
'max_points',
'status',
'excused_reason',
'locked_at',
'locked_by',
'comment',
'semester',
'school_year',
'created_at',
'updated_at',
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
'updated_by' => 'integer',
'quiz_index' => 'integer',
'score' => 'decimal:2',
'max_points' => 'decimal:2',
'locked_by' => 'integer',
'locked_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function student(): BelongsTo
{
return $this->belongsTo(Student::class, 'student_id');
}
public function classSection(): BelongsTo
{
return $this->belongsTo(ClassSection::class, 'class_section_id');
}
}