HasMany(SegmentConstant::class, 'segment_id', 'id'); } /** * @return belongsToMany */ public function companyConnections(): belongsToMany { return $this->belongsToMany(CompanyConnection::class, (new ConnectionSegment())->getTable(), 'segment_id', 'company_connection_id'); } }