MorphOneOrMany::firstOrCreate()

Model firstOrCreate(array $attributes) Get the first related record matching the attributes or create it. Parameters array $attributes Return Value Model

MorphOneOrMany::findOrNew()

Collection|Model findOrNew(mixed $id, array $columns = array('*')) Find a related model by its primary key or return new instance of the related model. Parameters mixed $id array $columns Return Value Collection|Model

MorphOneOrMany::createMany()

array createMany(array $records) Create an array of new instances of the related model. Parameters array $records Return Value array

MorphOneOrMany::createdAt()

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

MorphOneOrMany::create()

Model create(array $attributes) Create a new instance of the related model. Parameters array $attributes Return Value Model

MorphOneOrMany::addEagerConstraints()

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

MorphOneOrMany::addConstraints()

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

MorphOneOrMany

MorphOneOrMany class MorphOneOrMany extends HasOneOrMany (View source) Methods void __construct(Builder $query, Model $parent, string $type, string $id, string $localKey) Create a new morph one or many relationship instance. void addConstraints() Set the base constraints on the relation query. void addEagerConstraints(array $models) Set the constraints for an eager load of the relation. array initRelation(array $models, string $relation) Initialize the relation on a set of

MorphOne::__construct()

void __construct(Builder $query, Model $parent, string $type, string $id, string $localKey) Create a new morph one or many relationship instance. Parameters Builder $query Model $parent string $type string $id string $localKey Return Value void

MorphOne::__clone()

void __clone() Force a clone of the underlying query builder when cloning. Return Value void