OptionalforeignKeyOverride: keyof T & string
OptionallocalKeyOverride: keyof T2 & string
Override the foreign key property.
Override the local key property.
The model related from.
The model related to.
Get the name of the foreign key for this relation.
Get the name of the local key for this relation.
Get the value of the pivot for this relation from the parent model.
Get the fully-qualified name of the foreign key.
Get the fully-qualified name of the local key.
Get the query source for the related model in this relation.
Get the value of this relation.
Apply the relation's constraints on a model query.
Create an eager-load query matching this relation's models.
Get a new builder instance for this relation.
Get a collection of the results of this relation.
Given a collection of results, filter out those that are relevant to this relation.
Create a new query for this relation.
Makes the relation "thenable" so relation methods on models can be awaited to yield the result of the relation.
const rows = await myModelInstance.myHasManyRelation() -- rows is a Collection
One-to-one relation implementation.