Abstract
Protected
constructorOptional
foreignKeyOverride: keyof T & stringOverride the foreign key property.
Optional
localKeyOverride: keyof T2 & stringOverride the local key property.
Protected
Optional
foreignOverride the foreign key property.
Protected
Optional
localOverride the local key property.
Protected
parentThe model related from.
Readonly
relatedThe 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.
Abstract
getAbstract
getAbstract
isGiven a collection of results, filter out those that are relevant to this relation.
Create a new query for this relation.
Set the container for this instance.
Abstract
setMakes 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
Base class for 1:1 and 1:M relations.