SupportsPivotInverseRelations
trait SupportsPivotInverseRelations (View source)
Properties
| protected string|null | $declaringInverseRelationship | The name of the declaring model's relationship on the pivot. |
|
| protected string|null | $relatedInverseRelationship | The name of the related model's relationship on the pivot. |
Methods
Instruct Eloquent to link the declaring and related models back to the pivot after the relationship query has run.
Remove the chaperone relationships for this query.
Resolve the inverse relation name on the pivot for a given model.
Attempt to guess the inverse relation name on the pivot for a given model.
Apply chaperone relationships to a pivot model instance.
Details
SupportsPivotInverseRelations
chaperone(string|null $declaring = null, string|null $related = null)
Instruct Eloquent to link the declaring and related models back to the pivot after the relationship query has run.
SupportsPivotInverseRelations
withoutChaperone()
Remove the chaperone relationships for this query.
protected string|null
resolvePivotInverseRelation(Model $pivotModel, string|null $relation, string $foreignKey, Model $model)
Resolve the inverse relation name on the pivot for a given model.
If an explicit name is provided and invalid, an exception is thrown. If guessing fails, null is returned.
protected string|null
guessPivotInverseRelation(Model $pivotModel, string $foreignKey, Model $model)
Attempt to guess the inverse relation name on the pivot for a given model.