Skip to main content
zerotal

Documentation


Documentation / zerotal / orm / MorphToManyOptions

Interface: MorphToManyOptions

Defined in: packages/orm/src/model/decorators/morphToMany.ts:3

Properties

morphName

morphName: string

Defined in: packages/orm/src/model/decorators/morphToMany.ts:5

Morph name — prefix for the pivot {name}_id / {name}_type columns (e.g. 'taggable').


relatedPivotKey

relatedPivotKey: string

Defined in: packages/orm/src/model/decorators/morphToMany.ts:7

FK on the pivot table referencing the related model (e.g. 'tag_id').


pivotTable?

optional pivotTable?: string

Defined in: packages/orm/src/model/decorators/morphToMany.ts:9

Pivot table name. Defaults to {morphName}s.


withPivot?

optional withPivot?: string[]

Defined in: packages/orm/src/model/decorators/morphToMany.ts:11

Extra pivot columns to hydrate.


withTimestamps?

optional withTimestamps?: boolean

Defined in: packages/orm/src/model/decorators/morphToMany.ts:13

Maintain pivot timestamps.