IMMREX7
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Period extends Model
{
protected $primaryKey = 'idPeriod';
protected $table = 'periods';
protected $fillable = ['idSchool','idFinancialYear', 'idClass', 'idSection', 'periodName', 'fromTime', 'toTime','isLunchBreak'];
public function classM() {
return $this->belongsTo(ClassM::class, 'idClass', 'idClass');
}
public function section() {
return $this->belongsTo(Section::class, 'idSection', 'idSection');
}
public function teacher() {
return $this->belongsTo(Employee::class, 'idTeacher', 'idTeacher');
}
public function subject() {
return $this->belongsTo(Subject::class, 'idSubject', 'idSubject');
}
}
Copyright © 2021 -