1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 10:54:31 +00:00

Получение предметов и учеников класса, классов учителя

This commit is contained in:
nikden13
2020-12-09 00:03:57 +07:00
parent 5b0ba96adf
commit 3c93886fef
10 changed files with 51 additions and 9 deletions

View File

@@ -20,7 +20,8 @@ class Subject extends Model
public function schoolClasses()
{
return $this->belongsToMany(SchoolClass::class, 'academic_plans')->withPivot('hours_per_week', 'hours_per_year');
return $this->belongsToMany(SchoolClass::class, 'academic_plans', 'class_id')
->withPivot('hours_per_week', 'hours_per_year');
}
}