HasOneOrMany

HasOneOrMany class HasOneOrMany extends Relation (View source) Methods void __construct(Builder $query, Model $parent, string $foreignKey, string $localKey) Create a new has 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 models. from Re

HasOne::__construct()

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

HasOne::__clone()

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

HasOne::__call()

mixed __call(string $method, array $parameters) Handle dynamic method calls to the relationship. Parameters string $method array $parameters Return Value mixed

HasOne::wrap()

string wrap(string $value) Wrap the given value with the parent query's grammar. Parameters string $value Return Value string

HasOne::updateOrCreate()

Model updateOrCreate(array $attributes, array $values = array()) Create or update a related record matching the attributes, and fill it with values. Parameters array $attributes array $values Return Value Model

HasOne::updatedAt()

string updatedAt() Get the name of the "updated at" column. Return Value string

HasOne::update()

int update(array $attributes) Perform an update on all the related models. Parameters array $attributes Return Value int

HasOne::touch()

void touch() Touch all of the related models for the relationship. Return Value void

HasOne::saveMany()

Collection|array saveMany(Collection|array $models) Attach a collection of models to the parent instance. Parameters Collection|array $models Return Value Collection|array