As written in the error logs, maybe the error is caused different forms in the reference table and parent table but I still don't understand cause I'm new in programming
here table 1
<?php
Schema::create('questions', function (Blueprint $table) {
$table->id();
$table->string('question');
$table->unsignedInteger('quiz_id');
$table->timestamps();
});
here table 2
<?php
Schema::create('answers', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('question_id');
$table->string('answer');
$table->boolean('is_correct');
$table->timestamps();
});
Schema::table('answers', function (Blueprint $table){
$table->foreign('question_id')->references('id')->on('questions')->onDelete('cascade');
});
what should I change in this code? thanks