belongs('Objective')->belongs('Outcome'); // TODO: Changes here // return $this->belongs('Outcome'); return $this->hasManyThrough('Outcome', 'Objective'); } public function objectives() { return $this->belongsToMany('Objective'); } public function rubrics() { return $this->belongsToMany('Rubric', 'new_criterion_rubric'); } /** * Return the program that the criterion belongs to * * @return Illuminate\Database\Eloquent\Model */ public function program() { return $this->belongsTo('Program'); } public function subcriteria() { return json_decode($this->subcriteria); } }