tutoring/app/Models/StudentTeacherSubject.php

61 lines
1.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class StudentTeacherSubject extends Model
{
protected $fillable = [
'student_id',
'teacher_id',
'subject_id',
'rate_override',
'status',
'notes',
];
/**
* The student this relationship belongs to.
*/
public function student(): BelongsTo
{
return $this->belongsTo(StudentProfile::class, 'student_id');
}
/**
* The teacher assigned to this student for this subject.
*/
public function teacher(): BelongsTo
{
return $this->belongsTo(TeacherProfile::class, 'teacher_id');
}
/**
* The subject being taught.
*/
public function subject(): BelongsTo
{
return $this->belongsTo(Subject::class, 'subject_id');
}
/**
* Teaching arrangements (sessions/timetabled slots)
* linking this studentteacher subject pair to actual classes.
*/
public function teachingArrangements(): HasMany
{
return $this->hasMany(TeachingArrangementStudent::class);
}
/**
* Attendance records for this studentteachersubject combination.
*/
public function attendance(): HasMany
{
return $this->hasMany(LessonAttendance::class);
}
}