Level 23
yes..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, Good night.
I have a doubt with a query.
I have this tables
Schema::create('patients', function (Blueprint $table) {
$table->bigIncrements('id'); // Example 12
$table->string('name',100); //Example Jonh Con
$table->date('birthDate'); // Example 2018-01-01
});
schema::create('consultations', function (Blueprint $table) {
$table->bigIncrements('id'); // Example 2
$table->bigInteger('patient_id'); //Example 12
$table->date('date'); // Example 2018-09-01
//More Columns
});
}
Schema::create('anthropometries', function (Blueprint $table) {
$table->bigIncrements('id'); // Example 2
$table->bigInteger('consultation_id')->unsigned(); // Example 2
$table->double('height'); //Example 50
$table->string('mHeight'); // Example kg
//More Columns
});
My model Consultation
public function anthropometries()
{
return $this->hasOne('App\Models\Anthropometries','consultation_id');
}
Is there some query for get data of anthropometries with average for months ? Example
{
Juanary : {
height:50,
}
February:{
height:51,
}
etc...
}
PD: there is a query from the date of birth?
Please or to participate in this conversation.