Protected
cachedProtected
Optional
cachedProtected
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.
Resolve the result of this relation.
Get the value of this relation.
Given a collection of results, filter out those that are relevant to this relation.
Create a new query for this relation.
Set the value of 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-many relation implementation.