id(); $table->unsignedBigInteger('teacher_id'); $table->unsignedBigInteger('student_id'); $table->unsignedBigInteger('subject_id'); $table->unsignedBigInteger('score'); $table->string('comment')->nullable(); $table->timestamps(); $table->foreign('subject_id') ->references('id')->on('subjects'); $table->foreign('teacher_id') ->references('id')->on('teachers') ->onDelete('cascade'); $table->foreign('student_id') ->references('id')->on('students') ->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('journals'); } }