Files
alrahma_sunday_school_api/app/Models/Quiz.php
T
root e13df69885
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
fix unittests issues
2026-07-07 20:56:32 -04:00

39 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Quiz extends BaseModel
{
protected $table = 'quiz';
public $timestamps = true;
protected $fillable = ['student_id', 'school_id', 'class_section_id', 'updated_by', 'quiz_index', 'score', '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');
}
}