hasOne(SegmentTemplate::class, 'id', 'segment_template_id'); } public function note() { return $this->hasOne(Note::class, 'id', 'note_id'); } public function client() { return $this->hasOne(Client::class, 'id', 'client_id'); } public function shortName(){ return trim(array_reverse(explode('>', $this->display_title))[0]); } }