'datetime', ]; /** * Get the teacher that teaches this lesson. */ public function teacher(): BelongsTo { return $this->belongsTo(Teacher::class); } /** * Get the group for this lesson. */ public function group(): BelongsTo { return $this->belongsTo(Group::class); } /** * Get the students attending this lesson. */ public function students(): BelongsToMany { return $this->belongsToMany(Student::class, 'lesson_student') ->withPivot('attendance', 'score') ->withTimestamps(); } }