foreign('photo_id', 'fk_pt_p')->references('id')->on('photo')->onUpdate('NO ACTION')->onDelete('NO ACTION'); $table->foreign('tag_id', 'fk_pt_t')->references('id')->on('tags')->onUpdate('NO ACTION')->onDelete('NO ACTION'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('photo_tag', function(Blueprint $table) { $table->dropForeign('fk_pt_p'); $table->dropForeign('fk_pt_t'); }); } }