MorphToMany::detach()

int detach(mixed $ids = array(), bool $touch = true) Detach models from the relationship. Parameters mixed $ids bool $touch Return Value int

MorphToMany::createMany()

array createMany(array $records, array $joinings = array()) Create an array of new instances of the related models. Parameters array $records array $joinings Return Value array

MorphToMany::createdAt()

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

MorphToMany::create()

Model create(array $attributes, array $joining = array(), bool $touch = true) Create a new instance of the related model. Parameters array $attributes array $joining bool $touch Return Value Model

MorphToMany::chunk()

bool chunk(int $count, callable $callback) Chunk the results of the query. Parameters int $count callable $callback Return Value bool

MorphToMany::attach()

void attach(mixed $id, array $attributes = array(), bool $touch = true) Attach a model to the parent. Parameters mixed $id array $attributes bool $touch Return Value void

MorphToMany::addEagerConstraints()

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

MorphToMany::addConstraints()

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

MorphToMany

MorphToMany class MorphToMany extends BelongsToMany (View source) Methods void __construct(Builder $query, Model $parent, string $name, string $table, string $foreignKey, string $otherKey, string $relationName = null, bool $inverse = false) Create a new morph to many relationship instance. void addConstraints() Set the base constraints on the relation query. from BelongsToMany void addEagerConstraints(array $models) Set the constraints for an eager load of the relation. array

MorphTo::__construct()

void __construct(Builder $query, Model $parent, string $foreignKey, string $otherKey, string $type, string $relation) Create a new morph to relationship instance. Parameters Builder $query Model $parent string $foreignKey string $otherKey string $type string $relation Return Value void