id(); $table->string('nama', 100); $table->string('no_ktp', 20)->unique(); $table->string('email', 100)->unique(); $table->string('telepon', 20)->nullable(); $table->string('alamat', 150); // 🔥 RELASI $table->foreignId('rumah_id') ->nullable() ->constrained('rumah') ->onDelete('set null'); $table->enum('status', ['Aktif', 'Tidak Aktif'])->default('Aktif'); $table->enum('status_huni', ['Tetap', 'Kontrak'])->default('Tetap'); $table->date('tanggal_masuk')->nullable(); $table->date('tanggal_keluar')->nullable(); $table->unsignedBigInteger('user_id')->nullable(); $table->unsignedBigInteger('rt_id')->nullable(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('penghuni'); } };