Method |
Description |
|
__construct ( Builder $query, Model $parent, string $foreignKey ) : void |
Create a new has many 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. |
|
create ( array $attributes ) : Model |
Create a new instance of the related model. |
|
createMany ( array $records ) : array |
Create an array of new instances of the related model. |
|
getForeignKey ( ) : string |
Get the foreign key for the relationship. |
|
matchMany ( array $models, Collection $results, string $relation ) : array |
Match the eagerly loaded results to their many parents. |
|
matchOne ( array $models, Collection $results, string $relation ) : array |
Match the eagerly loaded results to their single parents. |
|
save ( Model $model ) : Model |
Attach a model instance to the parent model. |
|
saveMany ( array $models ) : array |
Attach an array of models to the parent instance. |
|
update ( array $attributes ) : integer |
Perform an update on all the related models. |
|