HasManyThrough::firstOrFail()

Model|HasManyThrough firstOrFail(array $columns = array('*')) Execute the query and get the first result or throw an exception. Parameters array $columns Return Value Model|HasManyThrough Exceptions ModelNotFoundException

HasManyThrough::first()

mixed first(array $columns = array('*')) Execute the query and get the first related model. Parameters array $columns Return Value mixed

HasManyThrough::findOrFail()

Model|Collection findOrFail(mixed $id, array $columns = array('*')) Find a related model by its primary key or throw an exception. Parameters mixed $id array $columns Return Value Model|Collection Exceptions ModelNotFoundException

HasManyThrough::findMany()

Collection findMany(mixed $ids, array $columns = array('*')) Find multiple related models by their primary keys. Parameters mixed $ids array $columns Return Value Collection

HasManyThrough::find()

Model|Collection|null find(mixed $id, array $columns = array('*')) Find a related model by its primary key. Parameters mixed $id array $columns Return Value Model|Collection|null

HasManyThrough::createdAt()

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

HasManyThrough::addEagerConstraints()

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

HasManyThrough::addConstraints()

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

HasManyThrough

HasManyThrough class HasManyThrough extends Relation (View source) Methods void __construct(Builder $query, Model $farParent, Model $parent, string $firstKey, string $secondKey, string $localKey) Create a new has many through 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 t

HasMany::__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