reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+34 -3
View File
@@ -2,11 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\BaseModel;
class ClassProgressReport extends Model
class ClassProgressReport extends BaseModel
{
protected $table = 'class_progress_reports';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'class_section_id',
'teacher_id',
@@ -28,5 +32,32 @@ class ClassProgressReport extends Model
'created_at',
'updated_at',
];
public $timestamps = true;
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');
}
public function teacher()
{
return $this->belongsTo(User::class, 'teacher_id');
}
public function attachments()
{
return $this->hasMany(ClassProgressAttachment::class, 'report_id');
}
}