project-ta/.history/app/Models/Rumah_20260331165601.php

35 lines
679 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Penghuni;
class Rumah extends Model
{
use HasFactory;
protected $table = 'rumah';
protected $fillable = [
'blok',
'no_rumah',
'status',
'luas_tanah',
'harga',
'gambar',
'keterangan',
'foto'
// 'denah', // 🔥 TAMBAHAN UNTUK DENAH
];
// =========================
// RELASI KE PENGHUNI (UPDATED)
// =========================
public function penghuni()
{
return $this->hasMany(Penghuni::class, 'rumah_id', 'id');
}
}