Files
alrahma_sunday_school_api/app/Models/Exam.php
T
2026-06-08 23:30:22 -04:00

45 lines
1014 B
PHP

<?php
namespace App\Models;
class Exam extends BaseModel
{
protected $table = 'exams';
/**
* Your legacy model only uses created_at (updatedField = '').
* In Laravel, easiest is to disable timestamps and manage created_at yourself OR
* enable timestamps but disable UPDATED_AT.
*
* We'll keep auto created_at, no updated_at:
*/
public $timestamps = true;
const UPDATED_AT = null; // ✅ no updated_at column
protected $fillable = [
'student_id',
'school_id',
'class_section_id',
'exam_name',
'created_at',
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
];
/* Optional relationships */
public function student()
{
return $this->belongsTo(Student::class, 'student_id');
}
public function classSection()
{
return $this->belongsTo(ClassSection::class, 'class_section_id');
}
}