belongsToMany('Course')->withTimestamps(); } public function program() { return $this->belongsTo('Program'); } public function assessed_activities() { //return $this->belongsToMany('Activity', 'assessments')->withPivot('scores', 'percentage')->withTimestamps(); return $this->belongsToMany('Activity', 'assessments')->withPivot('scores')->withTimestamps(); } }