Methods |
public
|
__construct(Builder $query, Model $parent, string $foreignKey, string $ownerKey, string $type, string $relation): void
Create a new morph to relationship instance.
Create a new morph to relationship instance.
Overrides
|
#
|
public
|
addEagerConstraints(array $models): void
Set the constraints for an eager load of the relation.
Set the constraints for an eager load of the relation.
Overrides
|
#
|
public
|
getEager(): mixed
Get the results of the relationship.
Get the results of the relationship.
Called via eager load method of Eloquent query builder.
Overrides
|
#
|
public
|
createModelByType(string $type): Model
Create a new model instance by type.
Create a new model instance by type.
|
#
|
public
|
match(array $models, Collection $results, string $relation): array
Match the eagerly loaded results to their parents.
Match the eagerly loaded results to their parents.
Overrides
|
#
|
public
|
associate(Model $model): Model
Associate the model instance to the given parent.
Associate the model instance to the given parent.
Overrides
|
#
|
public
|
dissociate(): Model
Dissociate previously associated model from the given parent.
Dissociate previously associated model from the given parent.
Overrides
|
#
|
public
|
touch(): void
Touch all of the related models for the relationship.
Touch all of the related models for the relationship.
Overrides
|
#
|
public
|
getMorphType(): string
Get the foreign key "type" name.
Get the foreign key "type" name.
|
#
|
public
|
getDictionary(): array
Get the dictionary used by the relationship.
Get the dictionary used by the relationship.
|
#
|
public
|
morphWith(array $with): MorphTo
Specify which relations to load for a given morph type.
Specify which relations to load for a given morph type.
|
#
|
public
|
morphWithCount(array $withCount): MorphTo
Specify which relationship counts to load for a given morph type.
Specify which relationship counts to load for a given morph type.
|
#
|
public
|
constrain(array $callbacks): MorphTo
Specify constraints on the query for a given morph type.
Specify constraints on the query for a given morph type.
|
#
|
public
|
__call(string $method, array $parameters): mixed
Handle dynamic method calls to the relationship.
Handle dynamic method calls to the relationship.
Overrides
|
#
|