belongsTo(User::class, 'homeroom_teacher_id'); } public function students() { return $this->hasMany(Student::class, 'class_id'); } }