Method |
Description |
|
__construct ( Builder $query, Model $parent, string $foreignKey, string $otherKey ) : void |
Create a new has many relationship instance. |
|
attach ( mixed $related ) : void |
Attach a model to the parent. |
|
create ( array $attributes ) : Model |
Create a new instance of the related model. |
|
createMany ( array $records ) : Model |
Create an array of new instances of the related models. |
|
detach ( integer $related ) : void |
Detach models from the relationship. |
|
getOtherKey ( ) : string |
Get the other key for the relationship. |
|
getResults ( ) : mixed |
Get the results of the relationship. |
|
initRelation ( array $models, string $relation ) : void |
Initialize the relation on a set of models. |
|
match ( array $models, Collection $results, string $relation ) : array |
Match the eagerly loaded results to their parents. |
|
save ( Model $model ) : Model |
Save a new model and attach it to the parent model. |
|
saveMany ( array $models ) : array |
Save an array of new models and attach them to the parent model. |
|
sync ( array $ids ) : void |
Sync the intermediate tables with a list of IDs. |
|