belongsTo(TutorCategory::class,'category_id','id'); } public function schedule_to_tutorSubjects() { return $this->belongsTo(TutorSubject::class,'subject_id','id'); } public function schedule_to_tutor() { return $this->belongsTo(User::class,'tutor_id','id'); } public function schedule_to_tutorCanTeach() { return $this->belongsTo(TutorCanTeach::class, 'subject_id', 'subject_id') ->where('category_id', $this->category_id); } }