<?php

namespace App\Models;

use App\Models\Schedule;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Subject extends Model
{
  use HasFactory;

  protected $fillable = ['subjectId', 'subjectTitle', 'syllabusDetails'];

  public function schedules()
  {
    return $this->belongsToMany(
      'App\Models\Schedule',
      'schedule_subject_rel',
      'subject_id',
      'schedule_id'
    );
  }

  public function exams()
  {
    return $this->hasMany('App\Models\Exam');
  }

  public function exam_results()
  {
    return $this->hasMany('App\Models\ExamResult');
  }
}
