/home/techb158/ileadtechnology.com/SSM/app/Models/academic
NameSizeModeActions
AcademicSession.php30350644editdlrm
Batch.php35630644editdlrm
Certificate.php29890644editdlrm
ClassTeacher.php18460644editdlrm
ClassTiming.php25450644editdlrm
ClassTimingSession.php16680644editdlrm
Course.php28770644editdlrm
Subject.php31870644editdlrm
SubjectTeacher.php15730644editdlrm
Timetable.php25640644editdlrm
TimetableAllocation.php15850644editdlrm
TimetableAllocationDetail.php14260644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/app/Models/academic/Subject.php (3187B)
'array']; protected $primaryKey = 'id'; protected $table = 'subjects'; protected static $logName = 'subject'; protected static $logFillable = true; protected static $logOnlyDirty = true; protected static $ignoreChangedAttributes = ['updated_at']; public function batch() { return $this->belongsTo('App\Models\Academic\Batch'); } public function subjectTeachers() { return $this->hasMany('App\Models\Academic\SubjectTeacher'); } public function timetableAllocationDetails() { return $this->hasMany('App\Models\Academic\TimetableAllocationDetail'); } public function getNameWithCodeAttribute() { return $this->name.' ('.$this->code.')'; } public function getOption(string $option) { return array_get($this->options, $option); } public function scopeFilterBySession($q) { return $q->whereHas('batch', function ($q1) { $q1->whereHas('course', function ($q2) { $q2->where('academic_session_id', '=', config('config.default_academic_session.id')); }); }); } public function scopeInfo($q) { return $q->with('batch', 'batch.course'); } public function scopeFilterById($q, $id) { if (! $id) { return $q; } return $q->where('id', '=', $id); } public function scopeFilterByBatchId($q, $batch_id) { if (! $batch_id) { return $q; } return $q->where('batch_id', '=', $batch_id); } public function scopeFilterByName($q, $name, $s = 0) { if (! $name) { return $q; } return ($s) ? $q->where('name', '=', $name) : $q->where('name', 'like', '%'.$name.'%'); } public function scopeFilterByCode($q, $code, $s = 0) { if (! $code) { return $q; } return ($s) ? $q->where('code', '=', $code) : $q->where('code', 'like', '%'.$code.'%'); } public function scopeFilterByShortcode($q, $shortcode, $s = 0) { if (! $shortcode) { return $q; } return ($s) ? $q->where('shortcode', '=', $shortcode) : $q->where('shortcode', 'like', '%'.$shortcode.'%'); } public function scopeFilterByIsElective($q, $is_elective) { return $q->whereIsElective($is_elective); } public function scopeFilterByHasNoExam($q, $has_no_exam) { return $q->whereHasNoExam($has_no_exam); } }