Files
Verde-Web/app/Http/Resources/HouseholdMemberResource.php
admin 4eb2d14e52 feat(backend): complete Module 4 (household registration)
households + household_members tables. Resident endpoints to create one
household (auto-resolves barangay from GPS), upload proof of residency,
manage members. Admin endpoints to list/approve/reject. Approving fires
HouseholdVerified event with a placeholder listener; Module 7 replaces
the body with actual QR batch allocation. Approved households are
immutable to residents; resubmitting after rejection resets to pending.

84 feature tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:06:37 +08:00

22 lines
637 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class HouseholdMemberResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'user_id' => $this->whenLoaded('user', fn () => $this->user?->uuid),
'relationship' => $this->relationship,
'full_name' => $this->full_name ?? ($this->user?->full_name),
'date_of_birth' => $this->date_of_birth?->toDateString(),
'joined_at' => $this->joined_at?->toIso8601String(),
];
}
}