Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class TeachingArrangement extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'teacher_id',
|
||||
'subject_id',
|
||||
'weekday',
|
||||
'start_time',
|
||||
'duration_minutes',
|
||||
'is_group',
|
||||
'max_students',
|
||||
'location_id',
|
||||
'fee_policy',
|
||||
'active',
|
||||
];
|
||||
|
||||
/**
|
||||
* The teacher running this arrangement.
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the session takes place (room, online, etc.)
|
||||
*/
|
||||
public function location(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Location::class, 'location_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Students assigned to this arrangement.
|
||||
*/
|
||||
public function students(): HasMany
|
||||
{
|
||||
return $this->hasMany(TeachingArrangementStudent::class, 'teaching_arrangement_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Attendance records generated from this arrangement.
|
||||
*/
|
||||
public function attendance(): HasMany
|
||||
{
|
||||
return $this->hasMany(LessonAttendance::class, 'teaching_arrangement_id');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user