'integer', 'class_section_id' => 'integer', 'admin_id' => 'integer', 'is_legacy' => 'boolean', 'version' => 'integer', 'previous_draft_id' => 'integer', 'reviewed_at' => 'datetime', ]; /** * legacy had updateOnlyChanged=false (force updates even if nothing changed). * In Laravel, you can force a save by calling: * $model->touch(); // updates updated_at only * or * $model->save(['timestamps' => true]); // normal save * * If you want a helper: */ public function forceSave(array $attributes = []): bool { if (!empty($attributes)) { $this->fill($attributes); } // Force updated_at refresh even if no attributes changed $this->updated_at = now(); return $this->save(); } /* Optional relationships */ public function teacher() { return $this->belongsTo(User::class, 'teacher_id'); } public function admin() { return $this->belongsTo(User::class, 'admin_id'); } public function classSection() { return $this->belongsTo(ClassSection::class, 'class_section_id'); } public function previousDraft() { return $this->belongsTo(self::class, 'previous_draft_id'); } }