increments('id'); $table->integer('game_id')->unsigned(); $table->foreign('game_id')->references('id')->on('games'); $table->integer('platform_id')->unsigned(); $table->foreign('platform_id')->references('id')->on('platforms'); }); Schema::table('games', function (Blueprint $table) { $table->dropForeign(['platform_id']); $table->dropColumn('platform_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('games_platforms'); Schema::table('games', function (Blueprint $table) { $table->unsignedInteger('platform_id')->nullable(); $table->foreign('platform_id')->references('id')->on('platforms'); }); } }