id('KomunalId'); $table->unsignedInteger('PelaporanId'); $table->enum('Tersambung', ['Iya', 'Tidak']); $table->index('PelaporanId', 'IndexKomunal_PelaporanId'); $table->foreign('PelaporanId') ->references('PelaporanId') ->on('Pelaporan') ->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('Komunal', function (Blueprint $table) { $table->dropForeign(['PelaporanId']); }); Schema::dropIfExists('Komunal'); } };