hasOne(Course::class, 'id', 'course_id'); } public function teacher() { return $this->hasOne(Teacher::class, 'id', 'teacher_id'); } public function courseSetting() { return $this->hasOne(CourseSetting::class, 'id', 'course_setting_id'); } public function courseContents() { return $this->hasMany(CourseContent::class, 'course_period_id', 'id'); } }