SupportsInverseRelations
trait SupportsInverseRelations (View source)
Properties
protected string|null | $inverseRelationship | The name of the inverse relationship. |
Methods
Instruct Eloquent to link the related models back to the parent after the relationship query has run.
Instruct Eloquent to link the related models back to the parent after the relationship query has run.
Guess the name of the inverse relationship.
Get the possible inverse relations for the parent model.
Set the inverse relation on all models in a collection.
Set the inverse relation on a model.
Get the name of the inverse relationship.
Remove the chaperone / inverse relationship for this query.
Remove the chaperone / inverse relationship for this query.
Details
$this
inverse(string|null $relation = null)
Instruct Eloquent to link the related models back to the parent after the relationship query has run.
Alias of "chaperone".
$this
chaperone(string|null $relation = null)
Instruct Eloquent to link the related models back to the parent after the relationship query has run.
protected string|null
guessInverseRelation()
Guess the name of the inverse relationship.
protected array
getPossibleInverseRelations()
Get the possible inverse relations for the parent model.
protected Collection
applyInverseRelationToCollection(Collection $models, Model|null $parent = null)
Set the inverse relation on all models in a collection.
protected Model
applyInverseRelationToModel(Model $model, Model|null $parent = null)
Set the inverse relation on a model.
string|null
getInverseRelationship()
Get the name of the inverse relationship.
$this
withoutInverse()
Remove the chaperone / inverse relationship for this query.
Alias of "withoutChaperone".
$this
withoutChaperone()
Remove the chaperone / inverse relationship for this query.