Advanced development Core classes HubletoMain\Core\ModelEloquent

HubletoMain\Core\ModelEloquent

Introduction

The Eloquent class defines the relations of a model.

Parameters

parameter Description type
table The name of the table in your database string

.

Creating relations

Relations are defined using Eloquent. Relations created must have their name in uppercase. The names of the relations need to match with the names of the relations in the Model class. Relations can be modified similarly to Eloquent query builder, for example adding order() or where() methods.

public function COMPANY(): BelongsTo {
  return $this->belongsTo(Company::class, 'id_company');
}

Check out  Eloquent Relations to learn more about Eloquent relations.

Next up

www.hubleto.com | Found a bug or missing something? Report an issue via GitHub.