BelongsTo::getOtherKey()

string getOtherKey() Get the associated key of the relationship. Return Value string

BelongsTo::getForeignKey()

string getForeignKey() Get the foreign key of the relationship. Return Value string

BelongsTo::getEager()

Collection getEager() Get the relationship for eager loading. Return Value Collection

BelongsTo::getBaseQuery()

Builder getBaseQuery() Get the base query builder driving the Eloquent builder. Return Value Builder

BelongsTo::dissociate()

Model dissociate() Dissociate previously associated model from the given parent. Return Value Model

BelongsTo::createdAt()

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

BelongsTo::associate()

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

BelongsTo::addEagerConstraints()

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

BelongsTo::addConstraints()

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

BelongsTo

BelongsTo class BelongsTo extends Relation (View source) Methods void __construct(Builder $query, Model $parent, string $foreignKey, string $otherKey, string $relation) Create a new belongs to 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.