IMMREX7
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Timetable extends Model {
protected $primaryKey = 'idTimetable';
protected $table = 'timetable';
protected $fillable = ['idSchool', 'idFinancialYear', 'idPeriod', 'idEmployee', 'idSubject', 'idWeekday'];
public function period() {
return $this->belongsTo(Period::class, 'idPeriod', 'idPeriod');
}
public function weekday() {
return $this->belongsTo(Weekday::class, 'idWeekday', 'idWeekday');
}
public function teacher() {
return $this->belongsTo(Employee::class, 'idEmployee', 'idEmployee');
}
public function subject() {
return $this->belongsTo(Subject::class, 'idSubject', 'idSubject');
}
}
Copyright © 2021 -