BelongsTo(Segment::class, 'segment_id', 'id'); } /** * @return mixed */ public function service(){ return $this->hasOne(ServiceType::class, 'id', 'detail->id') ->whereIn('reference', [SegmentConstants::SERVICE_TYPE, SegmentConstants::CUSTOM_SERVICE_TYPE]); } }