'decimal:2', 'has_electricity' => 'boolean', 'has_water' => 'boolean', 'is_active' => 'boolean', 'member_count' => 'integer', ]; public function head() { return $this->belongsTo(Resident::class, 'head_resident_id'); } public function members() { return $this->hasMany(HouseholdMember::class, 'household_id'); } public function activeMembers() { return $this->members()->where('is_active', true); } public function scopeActive($query) { return $query->where('is_active', true); } }