MorphTo::createModelByType()

Model createModelByType(string $type) Create a new model instance by type. Parameters string $type Return Value Model

MorphTo::createdAt()

string createdAt() Get the name of the "created at" column. Return Value string

MorphTo::associate()

Model associate(Model|int $model) Associate the model instance to the given parent. Parameters Model|int $model Return Value Model

MorphTo::addEagerConstraints()

void addEagerConstraints(array $models) Set the constraints for an eager load of the relation. Parameters array $models Return Value void

MorphTo::addConstraints()

void addConstraints() Set the base constraints on the relation query. Return Value void

MorphTo

MorphTo class MorphTo extends BelongsTo (View source) Methods void __construct(Builder $query, Model $parent, string $foreignKey, string $otherKey, string $type, string $relation) Create a new morph to relationship instance. void addConstraints() Set the base constraints on the relation query. from BelongsTo void addEagerConstraints(array $models) Set the constraints for an eager load of the relation. array initRelation(array $models, string $relation) Initialize the relatio

MorphPivot::__wakeup()

void __wakeup() When a model is being unserialized, check if it needs to be booted. Return Value void

MorphPivot::__unset()

void __unset(string $key) Unset an attribute on the model. Parameters string $key Return Value void

MorphPivot::__toString()

string __toString() Convert the model to its string representation. Return Value string

MorphPivot::__set()

void __set(string $key, mixed $value) Dynamically set attributes on the model. Parameters string $key mixed $value Return Value void