hasOne(HrSection::class, 'id', 'hr_section_id'); } public function getOldValue(){ switch($this->change_type){ case 'DATA': return $this->old_data; case 'STATUS': return $this->old_status; case 'PROPOSED_DATA': return $this->old_proposed_data; case 'PROPOSED_STATUS': return $this->old_proposed_status; default: return 'Unknown change type'; } } public function getNewValue(){ switch($this->change_type){ case 'DATA': return $this->new_data; case 'STATUS': return $this->new_status; case 'PROPOSED_DATA': return $this->new_proposed_data; case 'PROPOSED_STATUS': return $this->new_proposed_status; default: return 'Unknown change type'; } } }