Method |
Description |
|
__construct ( Builder $query, Model $parent, string $foreignKey, string $otherKey, string $relation ) : void |
Create a new belongs to relationship instance. |
|
addConstraints ( ) : void |
Set the base constraints on the relation query. |
|
addEagerConstraints ( array $models ) : void |
Set the constraints for an eager load of the relation. |
|
associate ( Model | integer $model ) : Model |
Associate the model instance to the given parent. |
|
dissociate ( ) : Model |
Dissociate previously associated model from the given parent. |
|
getForeignKey ( ) : string |
Get the foreign key of the relationship. |
|
getOtherKey ( ) : string |
Get the associated key of the relationship. |
|
getQualifiedForeignKey ( ) : string |
Get the fully qualified foreign key of the relationship. |
|
getQualifiedOtherKeyName ( ) : string |
Get the fully qualified associated key of the relationship. |
|
getRelation ( ) : string |
Get the name of the relationship. |
|
getRelationCountHash ( ) : string |
Get a relationship join table hash. |
|
getRelationQuery ( Builder $query, Builder $parent, array | mixed $columns = ['*'] ) : Builder |
Add the constraints for a relationship query. |
|
getRelationQueryForSelfRelation ( Builder $query, Builder $parent, array | mixed $columns = ['*'] ) : Builder |
Add the constraints for a relationship query on the same table. |
|
getResults ( ) : mixed |
Get the results of the relationship. |
|
initRelation ( array $models, string $relation ) : array |
Initialize the relation on a set of models. |
|
match ( array $models, Illuminate\Database\Eloquent\Collection $results, string $relation ) : array |
Match the eagerly loaded results to their parents. |
|
update ( array $attributes ) : mixed |
Update the parent model on the relationship. |
|