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
39 lines
976 B
PHP
39 lines
976 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 = false;
|
|
|
|
const UPDATED_AT = null; // ✅ no updated_at column
|
|
|
|
protected $fillable = ['student_id', 'student_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');
|
|
}
|
|
}
|