Files
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

46 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ClassProgressReport extends BaseModel
{
use HasFactory;
protected $table = 'class_progress_reports';
// ✅ legacy: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = ['class_section_id', 'teacher_id', 'week_start', 'week_end', 'subject', 'unit_title', 'materials', 'covered', 'homework', 'assessment', 'status', 'status_notes', 'class_notes', 'next_week_plan', 'support_needed', 'flags_json', 'attachment_path', 'created_at', 'updated_at'];
protected $casts = [
'class_section_id' => 'integer',
'teacher_id' => 'integer',
// change to 'datetime' if your columns are DATETIME
'week_start' => 'date',
'week_end' => 'date',
// If flags_json is JSON in DB, this makes it an array automatically
'flags_json' => 'array',
];
/* Optional relationships */
public function classSection()
{
return $this->belongsTo(ClassSection::class, 'class_section_id', 'class_section_id');
}
public function teacher()
{
return $this->belongsTo(User::class, 'teacher_id');
}
public function attachments()
{
return $this->hasMany(ClassProgressAttachment::class, 'report_id');
}
}