e907100175
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
814 B
PHP
29 lines
814 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class RumahMiskin extends Model
|
|
{
|
|
/** @use HasFactory<\Database\Factories\RumahMiskinFactory> */
|
|
use HasFactory;
|
|
|
|
protected $table = 'rumah_miskin';
|
|
protected $primaryKey = 'id_rumah';
|
|
public $incrementing = false;
|
|
protected $keyType = 'string';
|
|
protected $fillable = ['id_rumah', 'nama_kk', 'alamat', 'jumlah_kk', 'jumlah_orang', 'latitude', 'longitude', 'pekerjaan', 'pendapatan', 'kondisi_rumah', 'keterangan'];
|
|
|
|
public function anggota()
|
|
{
|
|
return $this->hasMany(AnggotaKeluarga::class, 'id_rumah', 'id_rumah');
|
|
}
|
|
|
|
public function bantuan()
|
|
{
|
|
return $this->hasMany(RiwayatBantuan::class, 'id_rumah', 'id_rumah');
|
|
}
|
|
}
|