Simple question: I\'m new to Laravel. I have this migration file:
Schema::create(\'lists\', function(Blueprint $table) {
$table->increments(\'id\');
I was doing the same but got error " id not exist" => so I changed my migration file as below :
question table migration content:
$table->id() => should change to $table->increments('id')
definitions of foreign key in Reply table:
$table->foreign('question_id')->references('id')->on('questions')->onDelete('cascade');
now your foreign key will work.