bigIncrements('id'); $table->string('name'); $table->string('type')->nullable(); $table->string('weekday')->nullable(); $table->string('time')->nullable(); $table->integer('room_id'); $table->integer('user_id'); $table->timestamps(); $table->foreign('room_id')->references('id')->on('rooms')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('subjects'); } }