Level 88
What have you tried so far?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
following is my code
Migration
public function up()
{
Schema::create('panels', function (Blueprint $table) {
$table->increments('id');
$table->string('serial');
$table->decimal('longitude', 9, 6);
$table->decimal('latitude', 8, 6);
$table->timestamps();
});
}
public function up()
{
Schema::create('one_hour_electricities', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('panel_id');
$table->foreign('panel_id')->references('id')->on('panels')->onDelete('cascade');
$table->integer('kilowatts');
$table->datetime('hour');
$table->timestamps();
});
}
i want to get the data from the second migration and show it on chart hourly basis of each day using specific panel id. what type of query will i need to execute to achieve this.
Please or to participate in this conversation.