bigIncrements('id'); $table->unsignedInteger('upload_id'); $table->unsignedBigInteger('photo_id'); $table->timestamps(); $table->foreign('upload_id') ->references('id')->on('uploads') ->onDelete('cascade'); $table->foreign('photo_id') ->references('id')->on('photos') ->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('upload_photos'); } }